@rplan/measure-it
v0.3.6
Published
[![Build Status](https://travis-ci.org/actano/rplan-measure-it.svg?branch=master)](https://travis-ci.org/actano/rplan-measure-it)
Downloads
42
Maintainers
Keywords
Readme
@rplan/measure-it
Introduction
This is a toolkit to measures runtime.
Usage
Usage node
import { start, stop, track } from '@rplan/measure-it'
function doSomeThing() {
// ...
}
start('foo')
doSomeThing()
stop('foo')
// alternative
track('bar', doSomeThing)
console.log(sortedTrackData())
Usage node async
import { start, stop, track } from '@rplan/measure-it'
function doSomeThing() {
// ...
}
const startTime = start('foo')
await doSomeThing()
stop('foo', startTime)
// ...
Usage browser
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