From 33ab8745b30295aa388cbecd39bd4cea3bc262bb Mon Sep 17 00:00:00 2001 From: Vitaly Turovsky Date: Sun, 1 Sep 2024 02:23:33 +0300 Subject: [PATCH] add debug stats --- src/topRightStats.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/topRightStats.ts b/src/topRightStats.ts index 71303e81..f0462ae6 100644 --- a/src/topRightStats.ts +++ b/src/topRightStats.ts @@ -75,3 +75,14 @@ export const statsEnd = () => { stats2.end() statsGl.end() } + +window.statsPerSec = {} +let statsPerSec = {} +window.addStatPerSec = (name) => { + statsPerSec[name] ??= 0 + statsPerSec[name]++ +} +setInterval(() => { + window.statsPerSec = statsPerSec + statsPerSec = {} +}, 1000)