Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    timethispublic

    NODE-BENCHMARK

    Node-benchmark implements the timethis, timethese, countit functions some folks with a Perl background may be familiar with.

    Install

      npm install timethis

    Usage

    var bench = require("timethis");
     
    bench.timethis(100,function(time){
      console.log("Tested @ " + time + bench.accuracy);
    },function(callback){
      setTimeout(function(){
        callback();
      }, 50);
    });
     
    bench.timethese(100,function(times){
      console.log("Times:" + JSON.stringify(times));
    },{
      "fun50":function(callback){
        setTimeout(function(){
          callback();
        }, 50);
      }
      ,"fun100":function(callback){
        setTimeout(function(){
          callback();
        }, 100);
      }
    });
     
    bench.countit(1000,function(iterations){
      console.log("Iterations: " + iterations);
    },function(callback){
      setTimeout(function(){
        callback();
      }, 500);
    });

    Keywords

    none

    install

    npm i timethis

    Downloadsweekly downloads

    1

    version

    0.1.0-1

    license

    none

    last publish

    collaborators

    • avatar