[ruby/benchmark] Adds Tms#to_h

[Feature #17601]
This commit is contained in:
Keith Bennett 2021-02-07 23:02:52 -05:00 committed by Marc-Andre Lafortune
parent 9328112b9d
commit 3a7ff66abc
2 changed files with 23 additions and 0 deletions

View file

@ -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
#