UNPKG

boss-timer

Version:
31 lines (27 loc) 737 B
/** * Yeah this is not a proper test yet. */ console.log('Running tests for boss-stopwatch') console.log(process.env.NODE_ENV) var Timer = require('../index') Timer.debug = true var sw = new Timer() sw.start() setTimeout(function(){ console.log('Split Test ' + sw.split().elapsed(-1) + 'ms') setTimeout(function(){ sw.split() console.log('Second Split ' + sw.split().elapsed(1) + 'ms') console.log('Elapsed ' + sw.elapsed() + 'ms') console.log('Stopping stopwatch for 1 second') sw.stop() setTimeout(function(){ sw.start() setTimeout(function(){ sw.stop() console.log('End ' + sw.elapsed() + 'ms') },500) },1000) },500) },500) console.log('Done!')