Mail Archives: djgpp/1997/07/08/10:07:28
Orlando Andico wrote:
> Well, under Linux time is only to 1/100th of a second. Besides, the jiffy
> count is updated in the kernel, and everything else uses that -- you don't
> need to install your own interrupt handler for timing purposes, you just
> read the number of jiffies. Unlike in DOS, I guess.
Which suggests the way I'd do it in DOS - install a TSR
(using realmode - one reason I'd keep a realmode assembler
around) to provide the function. Of course, you then have
the problem that you have to distribute that TSR and make
sure it's installed...
Trying to get an accurate time when it isn't done in the O/S
is always dodgy, especially under DOS where almost anything
can decide to inhibit interrupts for quite a long time. Some
of the MSDOS software - SMARTDRV in particular - used to be
very bad at that. Disk and other hardware drivers are common
culprits, and if you have the joystick driver then forget timing
altogether, because that has to do tight loops to get the
position.
If you really need accurate timing, nothing will substitute
for dedicated hardware. Unless you write your own O/S (or
don't need an O/S like a lot of embedded systems)...
Chris C
- Raw text -