Message-Id: <335E030E.B42@canvaslink.com> Date: Wed, 23 Apr 1997 08:39:42 -0400 From: Tom Grandgent Reply-To: tgrand AT canvaslink DOT com Organization: Canvas Link, Inc. Mime-Version: 1.0 To: Robert Humphris Cc: djgpp AT delorie DOT com Subject: Re: Measuring frame rate more often References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk 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.