From: adobecs5.kaist@... Date: 2016-05-24T13:42:13+00:00 Subject: [ruby-core:75703] [Ruby trunk Feature#3001] Ruby stdlib: Benchmark::Tms #memberwise drops labels Issue #3001 has been updated by CHEOLHO JEON. Ernest Prabhakar wrote: > =begin > http://ruby-doc.org/stdlib/libdoc/benchmark/rdoc/classes/Benchmark/Tms.html#M000016-source > > The implementation of Benchmark::Tms#memberwise only passes the computed time values when creating a new instance, e.g.: > > Benchmark::Tms.new(utime.__send__(op, x), > stime.__send__(op, x), > cutime.__send__(op, x), > cstime.__send__(op, x), > real.__send__(op, x) > ) > > It would seem consistent (and more informative) if it also passed in the current label (especially since there's no other way to set it): > > Benchmark::Tms.new(utime.__send__(op, x), > stime.__send__(op, x), > cutime.__send__(op, x), > cstime.__send__(op, x), > real.__send__(op, x), > label > ) > > Example: > > >> t = Benchmark.measure("foo") { sleep 0.1 } > => # > >> t2 = t / 2 > => # > =end any update on this? I think it should not drop labels... ---------------------------------------- Feature #3001: Ruby stdlib: Benchmark::Tms #memberwise drops labels https://bugs.ruby-lang.org/issues/3001#change-58833 * Author: Ernest Prabhakar * Status: Feedback * Priority: Normal * Assignee: ---------------------------------------- =begin http://ruby-doc.org/stdlib/libdoc/benchmark/rdoc/classes/Benchmark/Tms.html#M000016-source The implementation of Benchmark::Tms#memberwise only passes the computed time values when creating a new instance, e.g.: Benchmark::Tms.new(utime.__send__(op, x), stime.__send__(op, x), cutime.__send__(op, x), cstime.__send__(op, x), real.__send__(op, x) ) It would seem consistent (and more informative) if it also passed in the current label (especially since there's no other way to set it): Benchmark::Tms.new(utime.__send__(op, x), stime.__send__(op, x), cutime.__send__(op, x), cstime.__send__(op, x), real.__send__(op, x), label ) Example: >> t = Benchmark.measure("foo") { sleep 0.1 } => # >> t2 = t / 2 => # =end -- https://bugs.ruby-lang.org/ Unsubscribe: