From: "ko1 (Koichi Sasada)" Date: 2012-10-27T05:34:48+09:00 Subject: [ruby-core:48338] [ruby-trunk - Feature #3001] Ruby stdlib: Benchmark::Tms #memberwise drops labels Issue #3001 has been updated by ko1 (Koichi Sasada). Target version changed from 2.0.0 to next minor I changed target to next minor because there is no discussion on it. No feedback? ---------------------------------------- Feature #3001: Ruby stdlib: Benchmark::Tms #memberwise drops labels https://bugs.ruby-lang.org/issues/3001#change-31646 Author: DrErnie (Ernest Prabhakar) Status: Feedback Priority: Low Assignee: Category: lib Target version: next minor =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 -- http://bugs.ruby-lang.org/