Stampy is used to log time differences. You could use it to profile time-consuming operations.
Note that the first .log()
begins the starting timestamp. Consecutive .log()
just
prints the diff from the last timestamp.
var stampy = require('stampy');
var userStampy = new stampy({ mute: process.env === 'production' || config.g.enableTimestamps });
userStampy.log('Recording timestamps now');
db.user.findById(45, function(err, user) {
userStampy.log('User lookup');
});
prints the following
Recording timestamps now
User lookup - 127ms