1.0.8 • Published 6 years ago
perftimer v1.0.8
PerfTimer
A simple performance recorder. Please note that debugMode must be on or else nothing will happen.
Usage:
PerfTimer.debugMode(true); // <-- Important!
PerfTimer.start(`My random task`);
doStuff();
PerfTimer.stop(`My random task`);
// Write the results to file (/tmp/performance.log) and console.
PerfTimer.printReport('/my/path/performance.log');
PerfTimer
- static start(name: String)
- Starts timing a session of a specific name.
- static stop(name: String)
- Stops timing a session with a specific name.
- static reset()
- Clears all previous sessions.
static printReport(filePath: String)
- Prints the reports to a file at the path defined.
Development
Dev-mode -
gulp devwatch
- this mode will watch your files, run tests, lint your code, and compile them as you code.Tests -
gulp test
ornpm test
Created by Benedict Chen. If you like it, you can buy me a beer with PayPal.
Donate via Paypal
If you enjoy this repo, please support me. Donate
Please support us!