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.
2.0
omp_get_wtime
#include
#include
#include
#include "omp_testsuite.h"
#include "omp_my_sleep.h"
int omp_get_wtime(FILE * logFile)
{
double start;
double end;
double measured_time;
int wait_time = 1;
start = 0;
end = 0;
start = omp_get_wtime ();
my_sleep (wait_time);
end = omp_get_wtime ();
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)) ;
}