Using time.h and clock()

Using time.h and clock()

Hello, I'm using this function (clock() from time.h) in my program to get time spended to part of my job.

On local machine I have no problem with it (2x CPU, OS Windows 7, Intel Compiler \\ MSVCC), but when I try to run with it on PBS with qsub, I have bad values of time (f. ex. -0.0, -279.0 ... )

Is using this function not correct on this system?

2 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione
Ritratto di Mike Pearce (Intel)

Not sure why you're seeing these values, but if you're using OpenMP, I would suggest that you use the OpenMP time function:

#include
.
.
double start, end;
.
.
start = omp_get_wtime();

... Stuff to time

end = omp_get_wtime();
printf(" Took %f seconds.\n", end-start);

Accedere per lasciare un commento.