time-object

1.0.2 • Public • Published

time-object

NPM version Build Status Coverage Status

Code Climate Dependencies DevDependencies

PRs Welcome Commitizen friendly semantic-release

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

Readme

Keywords

Package Sidebar

Install

npm i time-object

Weekly Downloads

1

Version

1.0.2

License

MIT

Last publish

Collaborators

  • dustinspecker