From: Hiroshi Nakamura Date: 2011-01-19T10:20:10+09:00 Subject: [ruby-core:34580] Re: [PATCH] Add thread timing to Struct::Tms Hi, On Wed, Jan 19, 2011 at 06:26, Charles Oliver Nutter wrote: >> The addition of thread timings to Struct::Tms seems good to me. > > Actually, I just remember that someone (maybe me) proposed adding > Thread.times a long time ago, for the current thread's times. Now it > seems a little odd to me that you'd go to Process.times to get the > current Thread's times, especially since it seems like Process.times > would want to return *all* thread timings. I'd propose that > Process.times be implemented returning the same Tms structure with > only ctime and stime populated. Here's my challenge for Process.times of JRuby: http://jira.codehaus.org/browse/JRUBY-5296 about how Process.times works on MVM-supported and has-many-background-threads implementation. The patch I posted above (not included in any old version of JRuby) collects Thread.times for RubyThreads bound in the VM, but it would not match the name 'Process.times'. > Whether Benchmark would utilize Process.times or Thread.times is up for debate. I heard that Matz don't like to add 'VM' object at this moment but VM.times could be an option for some kind of benchmark I think. Anyway there's no solution that one thing matches all purposes I think, I'd propose to add these all timings to Process.times. Regards, // NaHi