funny gettimeofday



I have following code:

....
gettimeofday(&tv1,NULL);

// do something here

gettimeofday(&tv2,NULL);

printf("Elapsed time is: %d seconds\n", tv2.tv_sec-tv1.tv_sec);

///////////////////////////////////////////////////////////////
each time I get the following outcome:
Elapsed time is: -1140166903 seconds
Elapsed time is: -1140114602 seconds
.......

Anyone knows why?



-- 
View this message in context: http://www.nabble.com/funny-gettimeofday-tf1986993.html#a5453117
Sent from the Gtk+ - General forum at Nabble.com.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]