From: Jiri S. <jir...@bl...> - 2008-07-13 20:13:09
|
Libor Spacek wrote: > Nice work! Incidentally, I find clock() to be a pretty blunt tool with its > resolution of 10ms, which is way too long timelapse to measure most executions > on modern machines, apart from pretty massive tasks. For example, in real-time > image processing, you would process a whole image in no more than five ticks > of the clock(). gettimeofday is a lot more accurate but measures the elapsed time. > I am not even sure if clock() internally does any rounding, from what I can see > it is just a discrete counter running in 10ms units, meaning that CPU time of > as much as 9ms can register as 0 (zilch). > Hi Libor, I am not sure but I think you mentioned somewhere you are using Ubuntu 8.04. If so, then you can try to install the 'RT' (real time) Linux image. It contains timers with higher resolution. Jiri |