// Small script that prints the FPS to screen with regular intervals.
singleton FPSTicker;
import io, timer;
ulong lastFrame;
float delay = 1.5;
state tick
{
begin:
sleep(delay);
print("fps:", (frames.counter-lastFrame) / delay);
lastFrame = frames.counter;
goto begin;
}