|
-
May 11th, 2002, 07:34 PM
#1
Thread Starter
Hyperactive Member
Fps??
is there a way to show your fps?
-
May 11th, 2002, 11:03 PM
#2
PowerPoster
-
May 16th, 2002, 02:22 PM
#3
Fanatic Member
If you want to measure FPS in a game, you could do like this:
You need the GetTickCount API for this
VB Code:
public sub checkFPS()
dim lastCheck as long
dim FPS as long
dim tmpFPS as long
lastCheck = getTickCount
do
tmpFPS = tmpFPS + 1
if gettickcount - lastcheck > 1000 then
lastcheck = gettickcount
fps = tmpFPS
end if
doevents
loop
this is untested code, if it don't work, try to mix it a bit with a mixer
-
May 23rd, 2002, 10:31 PM
#4
Addicted Member
Each time you redraw, increment a variable:
Code:
CurrentFPS=CurrentFPS + 1
Then, every second, swap that to another variable:
Code:
If Int(Timer) <> Int(LastTimer) Then
DisplayFPS = CurrentFPS
CurrentFPS = 0
End If
LastTimer = Timer
That method works pretty well, though it's easy enough to improve.
"1 4m 4 1337 #4xz0r!'
Janus
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|