// ここから
#uselib "winmm.dll"
#cfunc timeGetTime "timeGetTime"
#cfunc timeBeginPeriod "timeBeginPeriod" int
dummy = timeBeginPeriod(1)
*main
gosub *get_fps
gosub *draw_fps
redraw 1:redraw 2
await 1000/60
goto *main
*draw_fps
// FPS の表示
gsel 0
color 0,0,0
boxf 0,0,640,16
pos 0,0
color 255,255,255
mes "" + fps + " FPS"
return
*get_fps
// FPS の計算
fpscount = fpscount + 1
now_time = timeGetTime()
if now_time >= last_time + 1000 {
last_time = now_time
fps = fpscount
fpscount = 0
}
return
// ここまで