Skip to content
This repository
Browse code

Simplified, faster implementation of Benchmark.realtime [Alexander Dymo]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8771 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 95af46861a80463833081c049f3a723e90c7ec01 1 parent 6d39d05
Michael Koziarski NZKoz authored

Showing 1 changed file with 12 additions and 0 deletions. Show diff stats Hide diff stats

  1. +12 0 activesupport/lib/active_support/core_ext/benchmark.rb
12 activesupport/lib/active_support/core_ext/benchmark.rb
... ... @@ -0,0 +1,12 @@
  1 +require 'benchmark'
  2 +
  3 +module Benchmark
  4 + remove_method :realtime
  5 + def realtime
  6 + r0 = Time.now
  7 + yield
  8 + r1 = Time.now
  9 + r1.to_f - r0.to_f
  10 + end
  11 + module_function :realtime
  12 +end

0 comments on commit 95af468

Please sign in to comment.
Something went wrong with that request. Please try again.