nx_fpsmeter.nx
buildroot/runtime/nx_fpsmeter.nx
about
nx_fpsmeter.nx -- sovereign rolling FPS meter: count the frame timestamps within the last 1000 ms. The call
stack currently measures NOTHING (can't answer "what fps are we at"); this is the instrument ("monitor the
system" law). State m[*i64]: [0]=head, [1]=count, [2 + i]=timestamp ring (FM_CAP). Assumes a real ms clock
(sys_now_ms). Pure buffer ops -> wasm-friendly (client) AND daemon-reusable. license_tier: ORIGINAL
dependencies 0 imports · 1 importers
imports: none
imported by: nx_fpsmeter_gate.nx
structs
| none |
consts
| 6 | const FM_CAP: i64 = 128 // tracks up to 128 fps |
functions
| 8 | func fm_init(m: *i64) -> i64 { m[0] = 0; m[1] = 0; var i: i64 = 0; while i < FM_CAP { m[2 + i] = 0; i = i + 1 } return 0 } called by 1: run_fps |
| 10 | func fm_tick(m: *i64, now_ms: i64) -> i64 called by 1: run_fps |
| 18 | func fm_fps(m: *i64, now_ms: i64) -> i64 called by 1: run_fps |