0.1.0 • Published 7 years ago

tic-toc v0.1.0

Weekly downloads
44
License
MIT
Repository
github
Last release
7 years ago
# 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