Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davidgilbertson/tinytimer
A basic function for timing areas of your javascript code. Outputs to the console.
https://github.com/davidgilbertson/tinytimer
Last synced: 13 days ago
JSON representation
A basic function for timing areas of your javascript code. Outputs to the console.
- Host: GitHub
- URL: https://github.com/davidgilbertson/tinytimer
- Owner: davidgilbertson
- Created: 2013-10-10T23:17:01.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-10-11T01:23:45.000Z (about 11 years ago)
- Last Synced: 2023-08-04T17:21:49.021Z (over 1 year ago)
- Size: 188 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
tinyTimer
=========Use the timer to record the running time for particular areas of your code, then output the results to the console in a neat little table.
If your browser doesn't support the console.table() command, the data will be output in plain text.
![screenshot](https://raw.github.com/davidgilbertson/tinyTimer/master/screenshot.png)
## Installation
Just copy paste the timer code into your code. Obviously you should be adding it your app's namespace.
If you prefer, you can include the script using a script tag, but if you're not concatenating you javascript files at build time then this is just another network request that the world doesn't need.
## Example Usage
tinyTimer.start('Load Data', 'This is my first run');
//Some code that takes some time to run
tinyTimer.next('Processing data');
//Some code that processes the data
tinyTimer.next('Draw to DOM')
//Some code that draws the data to the DOM
tinyTimer.stop();
You can visualize your data by typing the following in the console
tinyTimer.getHistory();
You can clear the history with tinyTimer.clear()