Files
automatic/javascript/timers.js
T
Vladimir Mandic 5baa23300d improve connection monitor and server restart
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-04-25 08:50:57 +02:00

15 lines
387 B
JavaScript

const allTimers = [];
async function timer(name, elapsed) {
allTimers.push([name, Math.round(elapsed)]);
}
async function logTimers() {
allTimers.sort((a, b) => b[1] - a[1]);
const filteredTimers = allTimers.filter((t) => t[1] > 50);
debug('startupTimers', filteredTimers);
// xhrPost(`${window.api}/log`, { debug: JSON.stringify(filteredTimers) });
}
window.timer = timer;