PDA

Click to See Complete Forum and Search --> : FPS calculation...


Arie
May 25th, 2001, 02:05 PM
Hi!

How can I calculate the FPS in my game
when I use GetTickCount?

Thank you,
Arie.

Fox
May 25th, 2001, 02:17 PM
'General
'Framecounter
Global StartTime As Long
Global FrameCount As Long
Global FPS As Long

'Game main
Sub Main()
Dim Temp As Long

'Main loop
While Active
Temp = GetTickCount

'Do game stuff here

'Calculate FPS
If StartTime < GetTickCount Then
FPS = FrameCount

'Code to show FPS goes here

FrameCount = 0
StartTime = GetTickCount + 1000
End If
FrameCount = FrameCount + 1

DoEvents
Wend
End Sub

Arie
May 25th, 2001, 02:21 PM
Arie.

Fox
May 25th, 2001, 02:29 PM
My pleasure, mylady ^_^