elapse

    0.1.1 • Public • Published

    Elapse v0.1.1

    Build Status NPM version Dependency Status

    Simple timer to track how long an operation takes.

    Install

    Available via npm

    npm install elapse

    Usage

    var elapse = require('elapse');
     
    elapse.time('LabelName');
    elapse.timeEnd('LabelName');

    Example

    Debug option set to true (default) outputs to stdout

    var elapse = require('elapse');
     
    elapse.configure({
        debug: true
    });
     
    elapse.time('AsyncOperation');
    setTimeout(function() {
        elapse.timeEnd('AsyncOperation');
        // Outputs:
        // Elapsed time: AsyncOperation: 1500ms
    }, 1500);
     

    Or you can store the result in a variable

    var elapse = require('elapse');
     
    elapse.configure({
        debug: false
    });
     
    elapse.time('AsyncOperation');
    setTimeout(function() {
        var elapsed = elapse.timeEnd('AsyncOperation');
        console.log(elapsed); // 1500
    }, 1500);
     

    Test

    Tests created using Jasmine

    npm test
    

    License

    Released under the MIT License.

    Install

    npm i elapse

    DownloadsWeekly Downloads

    0

    Version

    0.1.1

    License

    MIT

    Last publish

    Collaborators

    • miguelmota