/* * @@name: get_wtime.1 * @@type: C * @@operation: link * @@expect: success * @@version: pre_omp_3.0 */ #include #include #include void work_to_be_timed() { sleep(2); } int main() { double start, end; start = omp_get_wtime(); work_to_be_timed(); // any parallel or serial codes end = omp_get_wtime(); printf("Work took %f seconds\n", end - start); printf("Precision of the timer is %f (sec)\n", omp_get_wtick()); return 0; }