Pretty cool stuff.
But before you get your hands slapped -i would change the gosubs to functions
// Project: FPS Monitor
// Created: 2017-12-21
SetWindowTitle("FPS Monitor")
SetWindowSize(1024, 768, 0)
SetVirtualResolution(1024, 768)
SetDisplayAspect(1024/768.0)
SetWindowAllowResize(1)
UseNewDefaultFonts(1)
ClearScreen()
_FPS_Monitor_Init()
do
_FPS_Monitor()
Sync()
loop
function _FPS_Monitor_Init()
global FPS_Monitor as float[]
global fps_x as float
global fps_y as float
global fps_x1 as float
global fps_y1 as float
global fps_x2 as float
global fps_y2 as float
global fps_aspect as float
fps_x = 0
fps_y = 0
fps_aspect = 1024/768.0
endfunction
function _FPS_Monitor()
fps_x1 = fps_x2
fps_y1 = fps_y2
fps_x2 = fps_x
fps_y2 = fps_y
FPS_Monitor.insert(fps_y2)
fps_y = ScreenFPS()
// Draw lines
fps_i as integer
for fps_i=0 to FPS_Monitor.length
DrawLine(fps_i, 0, fps_i, FPS_Monitor[fps_i], 0, 255, 255)
next fps_i
// Debug Line
DrawLine((fps_x1 + 2), 0, fps_x2 + 1, fps_y2, 255, 0, 0)
if fps_x < GetDeviceWidth()
inc fps_x
else
fps_x = 0
fps_y = 0
FPS_Monitor.length = 0
endif
Print (fps_y)
endfunction
Maybe nice too to change the colors say from high range (green) - middle range (orange), low range (red)