Mail Archives: djgpp/1997/02/14/11:09:06
Why not Isolate the section you are wanting to time, then run through
it 1000 or so times. Like this
(Ugly pseudocode follows ; \ )
Get Start time
for i=0,1000
{
draw or whatever
}
Get Stop time
Approx time = (Stop time - Start time) / 1000
Maybe this will help.
Chad J. Molina
>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.
- Raw text -