From: Lauri K. <lau...@gm...> - 2006-08-22 10:35:03
|
2006/8/22, Philip Mitchell <mit...@tr...>: > > I am having problems with the clock() function which I am using for a delay > routine. Under Window (sorry for the foul language) the clock function > returns the number of clock ticks. This results in a millisecond result. Hi Philip, The clock function returns consumed CPU time by the process, not the real time. And the documentation says about the tick unit: "To determine the time in seconds, the value returned by clock() should be divided by the value of the macro CLOCKS_PER_SEC". Maybe you'll get the desired result with usleep() function, or get the time from gettimeofday(). -lauri |