mirror of
https://github.com/vladmandic/automatic
synced 2026-08-29 16:41:01 +02:00
40e550f1c3
Signed-off-by: vladmandic <mandic00@live.com>
15 lines
378 B
JavaScript
15 lines
378 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);
|
|
log('timers', filteredTimers);
|
|
// xhrPost(`${window.api}/log`, { debug: JSON.stringify(filteredTimers) });
|
|
}
|
|
|
|
window.timer = timer;
|