instiki/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb
Jacques Distler 4e14ccc74d Instiki 0.16.3: Rails 2.3.0
Instiki now runs on the Rails 2.3.0 Candidate Release.
Among other improvements, this means that it now 
automagically selects between WEBrick and Mongrel.

Just run

    ./instiki --daemon
2009-02-04 14:26:08 -06:00

20 lines
300 B
Ruby

require 'benchmark'
class << Benchmark
# Earlier Ruby had a slower implementation.
if RUBY_VERSION < '1.8.7'
remove_method :realtime
def realtime
r0 = Time.now
yield
r1 = Time.now
r1.to_f - r0.to_f
end
end
def ms
1000 * realtime { yield }
end
end