Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

Process.times

() -> ::Process::Tms
Process.times → process_tms

Returns a Process::Tms structure that contains user and system CPU times for the current process, and for its children processes:

Example
Process.times
# => #<struct Process::Tms utime=55.122118, stime=35.533068, cutime=0.0, cstime=0.002846>

The precision is platform-defined.

See also .spawn .uid .setsid .uid= also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0