summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-13 02:57:53 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-13 02:57:53 +0000
commitd68010a27cdaf6383d719c2fc35f1c28f5b35e3b (patch)
treed574070f6b47baaf80f759241bb0f1a399865338
parent7dce7a408e92e6f5638e8d64c7272da915842758 (diff)
merge revision(s) 15369:
* lib/benchmark.rb (Benchmark::realtime): make Benchmark#realtime a bit faster. a patch from Alexander Dymo <dymo@ukrpost.ua> in [ruby-core:15337]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@17123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--lib/benchmark.rb5
-rw-r--r--version.h2
3 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index fbfe45ce8c..9213305663 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jun 13 11:57:46 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * lib/benchmark.rb (Benchmark::realtime): make Benchmark#realtime
+ a bit faster. a patch from Alexander Dymo <dymo@ukrpost.ua> in
+ [ruby-core:15337].
+
Fri Jun 13 11:50:59 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (rb_open_file): should check NUL in path.
diff --git a/lib/benchmark.rb b/lib/benchmark.rb
index 36e593518f..bd91a6efe0 100644
--- a/lib/benchmark.rb
+++ b/lib/benchmark.rb
@@ -304,7 +304,10 @@ module Benchmark
# Returns the elapsed real time used to execute the given block.
#
def realtime(&blk) # :yield:
- Benchmark::measure(&blk).real
+ r0 = Time.now
+ yield
+ r1 = Time.now
+ r1.to_f - r0.to_f
end
diff --git a/version.h b/version.h
index 432136dfd9..34cdc460b4 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-06-13"
#define RUBY_VERSION_CODE 186
#define RUBY_RELEASE_CODE 20080613
-#define RUBY_PATCHLEVEL 170
+#define RUBY_PATCHLEVEL 171
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8