performance-measure
Version:
measure specializiing in speed up contests
29 lines (21 loc) • 430 B
JavaScript
const PerformanceMeasure = require('../')
async function main () {
const m = new PerformanceMeasure()
m.start('A')
await sleep(100)
m.end('A')
m.start('A')
await sleep(200)
m.end('A')
m.start('B')
await sleep(100)
m.end('B')
m.start('C')
await sleep(400)
m.endAs('C', 'foobar')
console.log(m.print())
}
main()
function sleep (ms = 0) {
return new Promise(resolve => setTimeout(resolve, ms))
}