tic-toc
v0.1.0
Published
Code timer for node
Downloads
2
Readme
# Install with npm
$ npm install --save tic-toc
// Use tic-toc to time stuff. Destructering used for this example,
// but you can use `import X from 'tic-toc'` to prevent namespace issues.
import { tic, toc, last, history } from 'tic-toc';
tic(); // Start timer
aFunctionThatIWouldLikeToTime();
toc(); // Returns time in seconds
anotherFunction();
toc(); // Returns the time in seconds since tic()
tic(); // Resets the timer
console.log( last() ); // Prints last interval
console.log( history() ); // Prints all timed intervals