historical/jsBench.git/bench.js
2024-01-16 11:20:27 -06:00

7 lines
252 B
JavaScript

//Note that (so far) the only reason this is async is to allow for other async functions to work.
async function jsBench(func) {
let preform = performance.now()
await func()
preform = performance.now()
return `Score: ${preform/1000} seconds`
}