async-measured

0.0.3 • Public • Published

async-measured

A drop in replacement for async that adds timings to functions.

I eventually want this to give measured timings on all functions. For now it just gives basic timings.

Currently it only supports basic measurements for async.series. Feel free to submit PR's for your own measurements.

Usage

var async = require("async-measured");

var timer = async.series([
    function (next) {
        setTimeout(next, 100);
    },
    function (next) {
        setTimeout(next, 50);
    }
], function () {
    console.log(timer);
});

After the async.series is done timer will be an object like:

{
    start: <timestamp>
    time: 150
    tasks: [
        {
            start: <timestamp> 
            time: 100
        },
        {
            start: <timestamp>
            time: 50
        }
    ]
}

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i async-measured

Weekly Downloads

2

Version

0.0.3

License

MIT

Last publish

Collaborators

  • timjrobinson