Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukaszkorecki/tiny_timer
really tiny timer for ruby code, nothing fancy
https://github.com/lukaszkorecki/tiny_timer
Last synced: 14 days ago
JSON representation
really tiny timer for ruby code, nothing fancy
- Host: GitHub
- URL: https://github.com/lukaszkorecki/tiny_timer
- Owner: lukaszkorecki
- Created: 2014-12-19T16:06:41.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-19T16:16:52.000Z (almost 10 years ago)
- Last Synced: 2024-10-04T18:21:08.419Z (about 1 month ago)
- Language: Ruby
- Size: 121 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tiny Timer
## Usage
Add the gem:
```ruby
gem 'tiny_timer', git: '[email protected]:lukaszkorecki/tiny_timer.git'
, branch: 'stable'```
use in your code:
```ruby
def needs_fixing
# marker, which IO object wrtie to, do we want rounding or not
# last 2 args are defaults
t = TinyTimer.new('GET /documents', STDOUT, true)did_something = t.measure('some op') { do_something }
something_else = t.measure('next op') { do_more(did_something) }t.summarize
something_else
end
```Will output something like:
```
|GET /documents| Start
|GET /documents| some op: 0.14s
|GET /documents| next op: 2.42s
|GET /documents| Total run time: 2.56s
|GET /documents| some op: 5.36% | next op: 94.51%
```