[ruby-dev:50137] [Ruby trunk Feature#11952] Use getrusage for Process.times if available

From: takashikkbn@...
Date: 2017-05-26 12:45:38 UTC
List: ruby-dev #50137
Issue #11952 has been updated by k0kubun (Takashi Kokubun).


Does anyone have opinion about this? Can I commit this?

I think it would be good to apply this patch to improve lib/benchmark.rb's precision.

----------------------------------------
Feature #11952: Use getrusage for Process.times if available
https://bugs.ruby-lang.org/issues/11952#change-65104

* Author: k0kubun (Takashi Kokubun)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Since times(3) has poor precision, I want to use getrusage(2) for Process.times to get better precision if getrusage is available.

before: Process.times #=> #<struct Process::Tms utime=0.06, stime=0.02, cutime=0.02, cstime=0.03>
after: Process.times #=> #<struct Process::Tms utime=0.065265, stime=0.026326, cutime=0.023249, cstime=0.029963>


---Files--------------------------------
0001-Use-getrusage-for-Process.times-if-available.patch (1.54 KB)


-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next