HOME
| OPENMP API Specification: Version 5.0 November 2018

3.4.1  omp_get_wtime

SummaryThe omp_get_wtime routine returns elapsed wall clock time in seconds.

Format

SVG-Viewer needed.

 

 
double omp_get_wtime(void);  

SVG-Viewer needed.

SVG-Viewer needed.

 

 
double precision function omp_get_wtime()  

SVG-Viewer needed.

BindingThe binding thread set for an omp_get_wtime region is the encountering thread. The routine’s return value is not guaranteed to be consistent across any set of threads.

EffectThe omp_get_wtime routine returns a 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 time returned is a per-thread time, so it is not required to be globally consistent across all threads that participate in an application.

SVG-Viewer needed.

Note – The routine is anticipated to be used to measure elapsed times as shown in the following example:

SVG-Viewer needed.

 

 
double start; 
double end; 
start = omp_get_wtime(); 
... work to be timed ... 
end = omp_get_wtime(); 
printf(~Work took %f seconds\n~, end - start);  

SVG-Viewer needed.

SVG-Viewer needed.

 

 
DOUBLE PRECISION START, END 
START = omp_get_wtime() 
... work to be timed ... 
END = omp_get_wtime() 
PRINT *, ~Work took~, END - START, ~seconds~  

SVG-Viewer needed.

SVG-Viewer needed.