UNPKG

damage

Version:

A simple way to calculate the 'damage' of running a task in Node.JS.

20 lines (13 loc) 358 B
var Damage = require('../'); Damage.prepare(function () { var fs = require('fs'); }); var damageOf = Damage(); damageOf('a lot of calculations',function () { for(var i=10000000;i<100000000;i++) Math.round(Math.log(i)*Math.sin(i)*Math.sqrt(i)); done(); },10) .is(function (processed,result) { console.log(result); });