historical/jsBench.git/bench.js

8 lines
252 B
JavaScript
Raw Normal View History

2024-01-16 11:20:27 -06:00
//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`
}