Class: RubyProf::Measure::CpuTime

Inherits:
Object
  • Object
show all
Defined in:
ext/ruby_prof/rp_measure_cpu_time.c

Class Method Summary collapse

Class Method Details

.cpu_frequencyInteger

Returns the cpu’s frequency. This value is needed when RubyProf::measure_mode is set to CPU_TIME.

Returns:

  • (Integer)


115
116
117
118
119
# File 'ext/ruby_prof/rp_measure_cpu_time.c', line 115

static VALUE
prof_get_cpu_frequency(VALUE self)
{
    return ULL2NUM(get_cpu_frequency());
}

.measureFloat

Returns the cpu time.

Returns:

  • (Float)


104
105
106
107
108
# File 'ext/ruby_prof/rp_measure_cpu_time.c', line 104

static VALUE
prof_measure_cpu_time(VALUE self)
{
    return rb_float_new(measure_cpu_time());
}