HP aC++/HP C A.06.20 Programmer's Guide

Timing Functions
The functions described in this section support a portable wall-clock timer:
omp_get_wtime
omp_get_wtick
omp_get_wtime
#include <omp.h>
double omp_get_wtime(void);
The omp_get_wtime function returns a double-precision floating-point value equal
to the elapsed wall clock time in seconds since some time in the past. The actual time
in the past is arbitrary, but it is guaranteed not to change during the execution of the
application program.
The function may be used to measure elapsed times as shown in the following example:
double start;
double end;
start = omp_get_wtime();
... work to be timed ...
end = omp_get_wtime();
printf(Work took %f sec. time.\n, end-start);
The time returned is per-thread times. They are not required to be globally consistent
across all the threads participating in an application.
omp_get_wtick
#include <omp.h>
double omp_get_wtick(void);
The omp_get_wtick function returns a double-precision floating-point value equal
to the number of seconds between successive clock ticks.
226 Exception Handling