root/trunk/activesupport/lib/active_support/core_ext/benchmark.rb
| Revision 9142, 160 bytes (checked in by josh, 5 months ago) |
|---|
| Line | |
|---|---|
| 1 | require 'benchmark' |
| 2 | |
| 3 | class << Benchmark |
| 4 | remove_method :realtime |
| 5 | |
| 6 | def realtime |
| 7 | r0 = Time.now |
| 8 | yield |
| 9 | r1 = Time.now |
| 10 | r1.to_f - r0.to_f |
| 11 | end |
| 12 | end |
Note: See TracBrowser for help on using the browser.