CodeTimer
Intro
A NodeJS module that let's you take time on how long it takes to execute code in your project.
Check wiki for change log and more information here
Install
npm install codetimer --save-dev
Usage
Example code on how to run CodeTimer in your project.
const CodeTimer = // import CodeTimer module. const ct = // Create new object from class. ctstart // Start the timer. let result = 0 for let i = 0; i < 1000000000; i++ // Do some calculations. result++ ct // Stop the timer. console // Print out the calculation.console // Print out the result. Result is in milliseconds by default.console // Convert result to seconds. eg 0.834.
Result
Result of above code should look something like this.
Result counter: 1000000000
Milliseconds: 965
Seconds: 0.965
Testing
If you want to try some functions before using this module
in your applications you can use the test.js
file located in the
root folder of this module and then run the file in your terminal with the command
node ./test.js
License
ISC - © Copyright Mikael Carlsson
Note
Feel free to contribute the way you want.