Reputation: 43
I have been looking for difference between the functions gettimeofday() and omp_get_wtime. Most of the places it was mentioned like,the gettimeofday() function has something to do with clock time and the omp_get_wtime() function has something to do with wall time . can someone tell me the difference between clock time and wall time ? and also difference between the two functions mentioned above ?
Upvotes: 0
Views: 1290
Reputation: 7227
The key is what happens if the system clock is changed while your program is running, e.g. because it was off 10 minutes and then it was reset by the user or via NTP.
If your program runs for 10 minutes, and the system time is changed by 20 minutes sometime in between, the clock time based functions will tell you that 30 minutes have elapsed, while the wall time functions will tell you that only 10 minutes have gone by.
Sometimes you want one, sometimes you want the other, that's for you to decide.
Uses for clock time:
Uses for wall time:
Upvotes: 1
Reputation: 763
"Wall time differs from time as measured by counting microprocessor clock pulses or cycles. The number of microprocessor clock cycle s per second of wall time depends on the microprocessor's clock speed."
You can find more info about this topic into this link. Have a good day. http://whatis.techtarget.com/definition/wall-time-real-world-time-or-wall-clock-time
Upvotes: 0