Mail Archives: djgpp/2002/10/19/06:00:34
> > I've looked at an alternate delay implementation. Getting timer tick
> > resolution is fairly easy, but since uclock() is also flakey I don't have
> > not checked in a updated delay() into the new release yet.
> I have access to a Win2k machine here and tried reading the latched
> timer tick this seems to work (using DJ's public compiler service :).
> My own timer routines are based on an absolute tick count which is
> composed of the BIOS' timer ticks low-word and the tick count.
This is how uclock works, but the bios area count is not coordinated with
the PIT. The roll over isn't at PIT 0, and it doesn't even happen exactly
at the same PIT value either for each tick (drift back and forth). At first
glance uclock() seems to work, but then you see ugly jumps occasionally.
This same drift is what makes delay() a mess, unless you try to busy wait
while hitting the PIT counter. Not the best method on a multi-tasking OS.
- Raw text -