times()
public
Returns a Tms structure (see Struct::Tms on page 388) that contains user
and system CPU times for this
process.
t = Process.times
[ t.utime, t.stime ]
Show source
VALUE
rb_proc_times(VALUE obj)
{
const double hertz =
(double)sysconf(_SC_CLK_TCK);
HZ;
struct tms buf;
volatile VALUE utime, stime, cutime, sctime;
times(&buf);
return rb_struct_new(rb_cProcessTms,
utime = DBL2NUM(buf.tms_utime / hertz),
stime = DBL2NUM(buf.tms_stime / hertz),
cutime = DBL2NUM(buf.tms_cutime / hertz),
sctime = DBL2NUM(buf.tms_cstime / hertz));
rb_notimplement();
}