| Class | Timer |
| In: |
lib/facet/timer.rb
|
| Parent: | Object |
Timer class. Also provides a block method for running a timed procedure.
require 'facet/timer'
timed { |timer|
timer.total_time.round #=> 0
sleep 1
timer.total_time.round #=> 1
timer.stop
timer.total_time.round #=> 1
sleep 2
timer.total_time.round #=> 1
timer.start
timer.total_time.round #=> 1
sleep 1
timer.total_time.round #=> 2
}
I would like to take this and meger it with TimeLimit in some manner.
Adapted from Ruby Treasures 0.4 Copyright (C) 2002 Paul Brannan <paul@atdesk.com>
You may distribute this software under the same terms as Ruby (see the file COPYING that was distributed with this library).
| VERSION | = | '0.1.0' |
| end_time | [R] | |
| start_time | [R] |