UNPKG

damage

Version:

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

21 lines (15 loc) 461 B
var Damage = require('../'); // Prepare (this function will be executed before every test) // This function execution will not affect the result. Damage.prepare(function () { var fs = require('fs'); }); var damageOf = Damage(); // \/ Task's description damageOf('reading a file',function () { // Your task fs.readFileSync(__filename); // Call done to end. done(); },1000); // /\ How many times will be executed