www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/14/04:21:53

From: frenchc AT cadvision DOT com (Calvin French)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: exact timming
Date: Thu, 13 Feb 1997 19:17:18 GMT
Organization: CADVision Development Corp.
Lines: 27
Message-ID: <5e10ub$479u@elmo.cadvision.com>
References: <199702111201 DOT NAA17664 AT atrey DOT karlin DOT mff DOT cuni DOT cz>
NNTP-Posting-Host: ts13ip217.cadvision.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Jan Hubicka <hubicka AT atrey DOT karlin DOT mff DOT cuni DOT cz> wrote:

>I have small problem:
>XaoS needs to quite exactly time one part of program. (Uses it to calculate
>framerate: time*5 so for framerate 30 I need to know time in precisity 1/150sec.
>) higher precisity is better.
>Gettimeofday(I using in unix) is not exact enought (1/18.2sec...4 or inf frames
>per second) 

>What is the best way to time this? Only I know about is to attach timer, set
>it to higher rate and make some my own counter. Can some send me code for this?
>Since I am lazy to study all irq attaching stuff under dpmi. Last time I did
>this is about 5 years ago in assembly.

Why not pick up Allegro? Allegro has excellent high precision timer
routines. If you like, you can also pick up my small library atimer
(x2ftp.oulu.fi/pub/msdos/programming/djgpp2/atimer.zip) which requires
Allegro but provides additional flexibility / ease of use.

There is a timer port, though, if you don't want to get Allegro. I'm
not sure what port address it is, but reading this port gets you the
time of day with 16bit precision, that is 65536 ticks per day, which
is often enough; I don't remember what the port address is, though :)
I highly reccomend allegro.

- Calvin -

- Raw text -


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