UNPKG

node-chrono

Version:

Meassure time ellapsed between to points in time or how much it takes a function to finish

19 lines (14 loc) 331 B
class Cronometer start: => @start_time = Date.now() finish: => @finish_time = Date.now() ellapsed: => @finish_time - @start_time @time: (f) => crono = new Cronometer crono.start() f() crono.finish() console.log "Time spent: #{crono.ellapsed()} ms" module.exports.Cronometer = Cronometer