ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/20/12:25:27

From: XXguille AT XXiies DOT XXes (Guillermo Rodriguez Garcia)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: high resolution timer
Date: Tue, 20 Apr 1999 17:00:38 GMT
Organization: Telefonica Transmision de Datos
Lines: 47
Message-ID: <371ca5ef.2477952@noticias.iies.es>
References: <8D53104ECD0CD211AF4000A0C9D60AE30130456A AT probe-2 DOT acclaim-euro DOT net>
NNTP-Posting-Host: iies210.iies.es
Mime-Version: 1.0
X-Newsreader: Forte Agent 1.5/32.451
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

El día Mon, 19 Apr 1999 14:38:56 +0100, Shawn Hargreaves
<ShawnH AT Probe DOT co DOT uk> escribió:

>Be aware, though, that timer 2 isn't emulated very well under win95, 
>so this may not work reliably there.

Ops!

>The CMOS should in theory be
>a totally reliable solution, but when I once tried to implement this
>in Allegro, a lot of people had problems with it. I never figured out
>exactly why this was, and it could of course just have been an error 
>in my code, but my best guess is that it was due to the motherboard
>and BIOS combination. So be warned: neither of these methods are
>likely to work on all machines and operating systems.

Guess I'll have to use timer 0, then.

>If you are already using timer 0 in your program, is there any way
>you can get time delay information from the same code that is
>generating the interrupts?

The problem is that I wanted to code a driver (well, sort of)
to be used with a few different applications, some of which
need timer 0 for themselves, so I wanted to use some other
resource for timing. But I guess I'll have to write some functions
to use the timer 0 in the driver and provide some timer facilities
for the underlying applications.

>That won't give really fine precision, 
>but should be fine up to 1/200 or so of a second.

That should be enough.

> Another option
>would be to use the Pentium clock register, but that wouldn't
>work on 486 and below...

But the Pentium clock register depends on the processor clock rate,
thus it is system-dependet, isn't it? I may be wrong; could you please
ellaborate this a bit more?

Regards,
GUILLE
----
Guillermo Rodriguez Garcia
XXguille AT XXiies DOT XXes (ya sabes :-)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019