High performance counter
cheers guys, thats helped loads! In addition, i''ve checked out the high performance counter on a 133Mhz Pentium (overclocked to 150 though) and it reports 1193180 iterations per second too! Ouch, i''m utterly confused!
PIT == 8254 timer
Basically it''s a 16 bit counter running at 1.193 MHz (wacky freq = original PC system clock / 12, so IBM saved a crystal. Thanks, guys)
It can be made to emit a regular interrupt (freq = input freq / divisor); div == 64k yields the infamous 18.2 Hz tick rate.
What QPC does is just read the counter.
Basically it''s a 16 bit counter running at 1.193 MHz (wacky freq = original PC system clock / 12, so IBM saved a crystal. Thanks, guys)
It can be made to emit a regular interrupt (freq = input freq / divisor); div == 64k yields the infamous 18.2 Hz tick rate.
What QPC does is just read the counter.
The frequency of the performance counter isn''t what matters. When doing calculations with it, you need to do all calculations in relation to QueryPerformanceFrequency. This allows you to base all your calculations per millisecond or per second. Anything below a (lets say..) 100''th of a millisecond is pretty much useless as you cannot query the performance counter fast enough anyways.
As for the Calculations, you can just use the 64bit values on pretty much any pentium system. Although they are 32 bit, they can add/sub/etc a 64 bit value atomically. Typically you''ll be using the performance counter values to calculate deltas, in which case you can typically cast them into 32 bit values without any loss of data.
As for the Calculations, you can just use the 64bit values on pretty much any pentium system. Although they are 32 bit, they can add/sub/etc a 64 bit value atomically. Typically you''ll be using the performance counter values to calculate deltas, in which case you can typically cast them into 32 bit values without any loss of data.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement