Skip to content

tool for measuring time of execution of async code

License

Notifications You must be signed in to change notification settings

pookong/async-timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published