Skip to content

Commit 9e489a9

Browse files
committed
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
1 parent 01c2a45 commit 9e489a9

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Fri Jun 13 11:56:28 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
2+
3+
* lib/benchmark.rb (Benchmark::realtime): make Benchmark#realtime
4+
a bit faster. a patch from Alexander Dymo <dymo@ukrpost.ua> in
5+
[ruby-core:15337].
6+
17
Fri Jun 13 11:42:52 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
28

39
* io.c (rb_open_file): should check NUL in path.

lib/benchmark.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,10 @@ def measure(label = "") # :yield:
304304
# Returns the elapsed real time used to execute the given block.
305305
#
306306
def realtime(&blk) # :yield:
307-
Benchmark::measure(&blk).real
307+
r0 = Time.now
308+
yield
309+
r1 = Time.now
310+
r1.to_f - r0.to_f
308311
end
309312

310313

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define RUBY_RELEASE_DATE "2008-06-13"
33
#define RUBY_VERSION_CODE 185
44
#define RUBY_RELEASE_CODE 20080613
5-
#define RUBY_PATCHLEVEL 169
5+
#define RUBY_PATCHLEVEL 170
66

77
#define RUBY_VERSION_MAJOR 1
88
#define RUBY_VERSION_MINOR 8

0 commit comments

Comments
 (0)