Mail Archives: djgpp-workers/2002/06/10/16:04:00
> Charles as you indicated in the first email Windows virtualised the TOD
> tick, so why not use the virtualised TOD tick on Windows NT/2K/XP instead of
> the timer registers?
Precision. The timer tick is 18 times per second, but we are looking for
millisecond (or better) resolution. We can get the timer tick, and we
can get the timer registers, but pulling them together in a consistent
manner seems to be a challenge. The timer tick in the bios is roughly
correct (and works) - but it seems it can drift a few milliseconds each
time it's set. So if you get a BIOS tick counter plus timer registers,
unless you are far from the tick changeover threshold you may get the
time wrong by up to a 1/18 of a second.
In DOS or Win9x the tic changes when the MSB timer counter passes zero.
In Win2K the two events are not related (it may happen when the timer
msb counter is 230, for example, with a range of 225 to 255 ). So,
if you enter uclock() and see timer register msb=230, did the clock
tick in the bios already happen, or will it happen soon? Unless you
have uclock delay to get far away from the threshold (which screws
up timing things with it) you can never be sure.
- Raw text -