blob: 9f0226df2f0883815bdfa10343b61dffd56ba634 [file] [log] [blame]
<ompts:testdescription>Test which checks the omp_get_wtime function. It compares the time with which is called a sleep function with the time it took by messuring the difference between the call of the sleep function and its end.</ompts:testdescription>
#include "omp_testsuite.h"
#include "omp_my_sleep.h"
int <ompts:testcode:functionname>omp_get_wtime</ompts:testcode:functionname>(FILE * logFile)
double start;
double end;
double measured_time;
int wait_time = 1;
start = 0;
end = 0;
<ompts:check>start = omp_get_wtime ();</ompts:check>
my_sleep (wait_time);
<ompts:check>end = omp_get_wtime ();</ompts:check>
measured_time = end-start;
fprintf(logFile, "Work took %lf sec. time.\n", measured_time);
return ((measured_time > 0.99 * wait_time) && (measured_time < 1.01 * wait_time)) ;