fps counter

Blitz3D Forums/Blitz3D Programming/fps counter

Please tell me if this is correct. I have readings of arond 450 fps according to this code. I know there's not much happening and a 128M graphics card helps, but isn't 400+ a bit much?

ClearWorld
Graphics3D 800,600,32,0
SetBuffer BackBuffer()
AmbientLight 200,200,200


redcube=CreateCube()
PositionEntity redcube,10,10,10
EntityColor redcube,200,10,10

greencube=CreateCube()
PositionEntity greencube,5,5,15
EntityColor greencube,10,200,10

bluecube=CreateCube()
PositionEntity bluecube,15,5,15
EntityColor bluecube,10,10,200

toplight=CreateLight(1)
PositionEntity toplight,-20,40,20
PointEntity toplight,redcube

sidelight=CreateLight(1)
PositionEntity sidelight,30,10,10
PointEntity sidelight,redcube

cam=CreateCamera()
CameraViewport cam,0,0,800,600
PositionEntity cam,10,5,10
PointEntity cam,redcube
MoveEntity cam,0,0,-10


timer#=MilliSecs()

	While Not KeyDown(1)

		TurnEntity redcube,1,0,0
		TurnEntity greencube,0,1,0
		TurnEntity bluecube,0,0,1

		UpdateWorld

		RenderWorld
			
			frames=frames+1
			fps#=(MilliSecs()-timer#)/1000
			fps#=(frames/fps#)
					
		Text 0,220,"Frames: "+frames+"          "
		Text 0,240,"Seconds: "+(MilliSecs()-timer#)/1000+"          "
		Text 0,260,"Frames Rendered Per Second: "+fps+"          "
		
		Flip

	Wend

ClearWorld
EndGraphics
End