Strange timing results
norume at aps.anl.gov
Fri May 19 20:54:40 UTC 2006
On May 19, 2006, at 3:46 PM, Alexandre Constantino wrote:
> Thank you for your reply Joel.
> I shouldn't have assumed the values were in microseconds, and after
> looking at the pc386 timer.c things became clearer.
> QEMU has some issues with the clock. On QEMU's forum some people
> complained about some OSs running too fast or too slow. And AFAIK
> isn't any way to tune the clock ATM.
> One interesting thing with QEMU was that setting a periodic timer to
> sleep SEC seconds resulted in a sleep of SEC * 10.
> I wrote a simple test that consisted on a sleep of 1 second, 6
> times. So
> that should take 6 seconds, but instead it took 60 seconds.
> (I double checked the time settings, and made it print its sleep time,
> to make sure I didn't add an extra zero)
> But as to how QEMU works with the TSC register... I don't know either.
> On another note it seems that my timings don't scale as they should. I
> would assume this to be a consequence of caching and other eventual
> After running tmck.exe, 3 times, these were the values I got:
> LOOP( 1,000) 9,139
> LOOP( 10,000) 80,070
> LOOP( 100,000) 900,070
> LOOP( 1,000,000) 8,000,075
> LOOP( 10,000,000) 80,000,067
> LOOP( 100,000,000) 800,000,069
> LOOP(1,000,000,000) 410,065,473 <- this one is very strange
No it's not.
10*800,000,069 won't fit into a 32-bit integer...
Eric Norum <norume at aps.anl.gov>
Advanced Photon Source
Argonne National Laboratory
More information about the users