07-21-06 12:24 AM
Casper H.S. Dik wrote:
>
[vbcol=seagreen]
[vbcol=seagreen]
> You can't and the above code does not give you anything you can
> reliably use, specifically not in the case of power management
> and multiple CPUs.
Well, it depends upon what information you are looking for. If you want
to know how many clock ticks have passed, the code is very useful. If
you want to know how much wall time, not so much.
You are correct that SMP machines with unsynchronized TSCs will be a
problem. Also, of course, this will only work on Pentium-class machines
that have a TSC.
However, this is extremely useful for measuring how many clock cycles a
chunk of code takes on machines where it is known to work.
DS
[ Post a follow-up to this message ]
|