This is a toolkit to measures runtime.
import { start, stop, track } from '@rplan/measure-it'
function doSomeThing() {
// ...
}
start('foo')
doSomeThing()
stop('foo')
// alternative
track('bar', doSomeThing)
console.log(sortedTrackData())
import { start, stop, track } from '@rplan/measure-it'
function doSomeThing() {
// ...
}
const startTime = start('foo')
await doSomeThing()
stop('foo', startTime)
// ...
import { start, track } from '@rplan/measure-it/lib/browser'
function doSomeThing() {
// ...
}
const stop = start('foo')
doSomeThing()
stop()
// alternative
track('bar', doSomeThing)
// press keys ctrl + 'l' to log performance results to the browser console
// press keys ctrl + 'r' to reset results