www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/23/08:53:35

Message-Id: <335E030E.B42@canvaslink.com>
Date: Wed, 23 Apr 1997 08:39:42 -0400
From: Tom Grandgent <tgrand AT canvaslink DOT com>
Reply-To: tgrand AT canvaslink DOT com
Organization: Canvas Link, Inc.
Mime-Version: 1.0
To: Robert Humphris <r DOT humphris AT indigo-avs DOT com>
Cc: djgpp AT delorie DOT com
Subject: Re: Measuring frame rate more often
References: <c=GB%a=_%p=Indigo_Active_Vi%l=CRIANLARICH-970423120229Z-458 AT crianlarich DOT Indigo>

Robert Humphris wrote:
> 
> Tom
> 
> You could attempt this by using some form of external counter that
> you can refer to each time you flip pages.  How you do this I don't
> know as I work in embedded systems that have all manner of clocks
> for just this sort of thing.  Does the PC have a microsecond clock?
> if so just refer to it and compare previous times.  if there is no
> clock, and you think that the overheads will not be too great, set
> an interrupt to occur every so often ( mS ) and count the number of 
> times that it has occurred between page flips.  To overcome the
> overhead of the interrupts you might want to create a look up table
> of logical speeds ranging from the fastest frame rate to that of the
> slowest, therefore you will not incur the time penalty of performing
> the recalculation each time.
> 
> Rob Humphris

Yes, I sort of tried this last night- I tried to measure the number
of milliseconds that it took to draw one frame.  Unfortunately the
results varyed widely- for example, they could go 55ms, 45ms, 75ms..
Always in multiples of 5.  Of course, this -was- under Win95.. :)  
So the jumpiness is still in the game...  Maybe my formula change
was incorrect, but I don't think the millisecond measurements from
my interrupt being called every millisecond are accurate.  Anyway:

Old (for frames per second):
effective_speed = logical_speed * (1 / fps / TARGET_FPS);

New (for milliseconds per frame):
effective_speed = logical_speed * (1 / ms / TARGET_MS);

Thanks for your help,

	Tom Grandgent
	tgrand AT canvaslink DOT com
	Canvas Link, Inc.

- Raw text -


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