pookong / async-timer

tool for measuring time of execution of async code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tool for measuring time of execution of async code

START / END

var asyncTimer = require('async-timer');

var timer = asyncTimer();

var task = function () {
  timer.end('KEY1');
  console.log(timer.getMeasured());
}

timer.start('KEY1');
setTimeout(task, 500);

WRAP

var asyncTimer = require('async-timer');

var timer = asyncTimer();

var task = function (next) {
  setTimeout(next, 500);
}

var callback = function (next) {
  console.log(timer.getMeasured());
}

var wrapped = timer.wrap(task, 'KEY2');
wrapped(callback);

About

tool for measuring time of execution of async code

License:MIT License


Languages

Language:CoffeeScript 100.0%