プレイ日記
Scientist Speedy1101
How can I display fps?
5そうだね
プレイ済み
返信[1]
親投稿
Here's what I do: Declare 2 global variables: FPS, and MS Find a part of code that gets ran every frame, preferably your main loop. Place this code: FPS=(FPS*11+1000/(MILLISEC-MS))/12 MS=MILLISEC ?FPS You'll notice the *11 and /12 or /(11+1), that will stabilize the number so it moves smoothly, and 11 has been tested as a good smoothness ratio.
3そうだね
プレイ済み
返信[2]
親投稿
Hanzo rzsense
Could you refer to the following program? DIM ITV[60]:FILL ITV,0 PTR=0:PMS=MILLISEC 'START OF LOOP ITV[PTR]=MILLISEC-PMS PMS=MILLISEC:PTR=(PTR+1)MOD 60:TTL=0 FOR I=0 TO 59:TTL=TTL+ITV[I]:NEXT I IF TTL!=0 THEN FPS=60/(TTL/1000) ELSE FPS=0 LOCATE 2,2:?FORMAT$("%6.1F FPS",FPS) 'END OF LOOP
2そうだね
未プレイ
返信[3]
親投稿
Hanzo rzsense
I explain my previous post. ITV array always stores frame to frame interval of past 60 frames. MILLISEC system variable is integer, but usually frame to frame interval isn't integer. Therefore I find the solution as average of whole ITV array. And FPS is the reciprocal of it. "/1000" stands for msec to sec modification.
2そうだね
未プレイ
返信[4]
親投稿
Scientist Speedy1101
Thanks! I'm going to need that information when my games start to get a little crazy.
0そうだね
プレイ済み