Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gyandeeps/jstimer
API to put timers inside your JavaScript code.
https://github.com/gyandeeps/jstimer
Last synced: 22 days ago
JSON representation
API to put timers inside your JavaScript code.
- Host: GitHub
- URL: https://github.com/gyandeeps/jstimer
- Owner: gyandeeps
- License: mit
- Created: 2013-10-09T17:25:29.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-09-23T03:07:30.000Z (about 10 years ago)
- Last Synced: 2024-10-14T12:17:39.237Z (25 days ago)
- Language: JavaScript
- Size: 211 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
jsTimer
=======API to put timers inside your JavaScript code.
TIMER FOR JavaScript
To use this function, please place this function inside your code.
- Create an object of this function by passing in a component name and true or false depending upon if you want to see your timer value as alerts.
by default alert would be false.
- By using that object you can create and start a timer by calling startTimer function and specify the timer name.
- By using the same Object, you can stop a timer by calling stopTimer function and specify the timer name.
- By using the same Object, you can kill a timer by calling killTimer function and specify the timer name to kill.
- By using the same Object, you can print all timers you have created so far by calling printAllTimer function.
- By using the same Object, you can check if the timer has started or not by calling hasStarted function with timer name.
- By using the same Object, you can check timer status by calling timerStatus function with timer name.Example:
var timerObj = new timersForPerformance("Ambulatory Organizer", false);
timerObj.startTimer("Retrieve data");
timerObj.startTimer("Render data");
timerObj.stopTimer("Retrieve data");timerObj.stopTimer("Render data");
timerObj.printAllTimer(); //this would print the info for the top 2 timer.
* You can define as many timers as you want.
This is not a perfect timer function. Lot of enhancements would be made in the future.
Any kind of suggestions or feedbacks or contribution would be highly appreciated.