Mail Archives: djgpp/1997/04/23/16:43:21
On Tue, 22 Apr 1997 10:40:27 GMT, Christoph Kukulies
<kuku AT gilberto DOT physik DOT rwth-aachen DOT de> wrote:
> I need a (relatively fine grained) time base and I'm thinking of using
> the system timer chip for this purpose. Never programmed that chip
> before and never dealt with hardware interrupts under djgpp.
>
> Can anyone point me to some sample code?
The DJGPP FAQ says:
>>>
check out the example of hooking the timer interrupt, e.g.
ftp://ftp.coast.net/Coast/msdos/c/pctime13.zip.
<<<
But first have a look at the uclock() function mentioned in the libc
info file:
>>>
`uclock' is provided for very high-resulution timing. It is currently
accurate to better than 1 microsecond (actually about 840 nanoseconds).
<<<
> The timer should interrupt at a rate of 10 KHz and the interrupt
> service routine is just supposed to increment a global 32 bit value.
>
> Hope, the 10KHz doesn't bring down the overall system performance.
10kHz interrupt rate sound very hard - most likely it's easier to call
uclock() just when you need it instead of incrementing a counter all the
time.
Regards...
Michael
- Raw text -