mirror of
https://github.com/vladmandic/automatic
synced 2026-08-25 22:20:46 +02:00
57f5bf5bd5
Co-authored-by: Copilot <copilot@github.com> Signed-off-by: Vladimir Mandic <mandic00@live.com>
17 lines
480 B
JavaScript
17 lines
480 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] > 100);
|
|
const objTimers = {};
|
|
for (const [name, elapsed] of filteredTimers) objTimers[name] = elapsed;
|
|
debug('startupTimers', objTimers);
|
|
// xhrPost(`${window.api}/log`, { debug: JSON.stringify(objTimers) });
|
|
}
|
|
|
|
window.timer = timer;
|