hog Posted December 6, 2003 Posted December 6, 2003 This is the text and function detailed in a book I'm reading; This function uses the system.environment.tickcount to retrieve the current tick of the processor clock (with the precision rate of a millisecond), so we can calculate the frame rate. Note this functionis not very accurate, but since we only use frame rate calculations to give us an idea of the speed at which we're drawing the scene, and won't include it in our final games, we think using it is a valid approach Public Function CalcFrameRate() As Integer Static FrameRate As Integer Static LastFrameRate As Integer Dim LastTick As Integer If System.Environment.TickCount - LastTick >= 1000 Then LastFrameRate = FrameRate FrameRate = 0 LastTick = System.Environmetn.TickCount End If FrameRate += 1 CalcFrameRate = LastFrameRate End Function In plain English, why is this not accurate? Thnx Quote My website
Moderators Robby Posted December 6, 2003 Moderators Posted December 6, 2003 A single second cannot be divided by a thousand with great accuracy. Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.