summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-13 02:57:18 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-13 02:57:18 +0000
commit9e489a9dead8f9799abe2d8df3b85a51fd2fd746 (patch)
treeb6be71342f071df81539298e076f72b1271ceea3
parent01c2a451ad9c1976fe7ceb55d8bc7626fc9ce50c (diff)
downloadruby-9e489a9dead8f9799abe2d8df3b85a51fd2fd746.tar.gz
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_5@17121 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 ca70f99462..80eae866e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jun 13 11:56:28 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:42:52 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 ea62dcd208..0120caf155 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 9bd1f61794..f6dac2c2f7 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-06-13"
#define RUBY_VERSION_CODE 185
#define RUBY_RELEASE_CODE 20080613
-#define RUBY_PATCHLEVEL 169
+#define RUBY_PATCHLEVEL 170
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8