time-object
v1.0.2
Published
Wrap an object's functions such that each one logs execution time
Downloads
107
Readme
time-object
Wrap an object's functions such that each one logs execution time
Install
npm install --save time-object
Usage
import timeObject from 'time-object'
const obj = {
value: 'hello',
func1() {
return 'hello'
},
func2() {
return 'bye'
}
}
timeObject(obj)
obj.func1()
// func1: 0.052ms
// => 'hello'
obj.func2()
// func2: 0.052ms
// => 'bye'
API
timeObject(obj)
Wraps the functions on an object such that each one logs execution time.
obj
type: object
The object to wrap.
LICENSE
MIT © Dustin Specker