mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
parent
9328112b9d
commit
3a7ff66abc
2 changed files with 23 additions and 0 deletions
|
@ -527,6 +527,20 @@ module Benchmark
|
|||
[@label, @utime, @stime, @cutime, @cstime, @real]
|
||||
end
|
||||
|
||||
#
|
||||
# Returns a hash containing the same data as `to_a`.
|
||||
#
|
||||
def to_h
|
||||
{
|
||||
label: @label,
|
||||
utime: @utime,
|
||||
stime: @stime,
|
||||
cutime: @cutime,
|
||||
cstime: @cstime,
|
||||
real: @real
|
||||
}
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue