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 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit 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 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 :-)