1.0.2 • Published 8 years ago

time-object v1.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

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

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago