Packages

Easily time execution of a block or function!

Current section

Files

Jump to
pocket_watch src pocket_watch_ffi.mjs
Raw

src/pocket_watch_ffi.mjs

export function elapsed(fun) {
const start = globalThis.performance.now();
const ret = fun();
const stop = globalThis.performance.now();
return (ret, stop - start * 1000000);
}