Timing sync or promise-returning functions
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.travis.yml
History.md
LICENSE
README.md
index.js
package.json
test.js

README.md

time-promise

Timing sync or promise-returning functions.

NPM

Build status dependencies devdependencies endorse

Install

npm install time-promise --save

Example

var time = require('time-promise');

var value = time(syncFunction)();
// prints timing, returns value from syncFunction

time(promiseReturningFunction)().then(...)
// prints timing after the function executes
// returns the original promise

Small print

Author: Gleb Bahmutov © 2013

License: MIT - do anything with the code, but don't blame me if it does not work.

Support: if you find any problems with this module, email / tweet / open issue on Github