Sha256: a3ebd936dfc108fdbbdfc7d33724f87d713f7737826efed3c09cb57728a362d2

Contents?: true

Size: 1.17 KB

Versions: 11

Compression:

Stored size: 1.17 KB

Contents

/* Copyright (C) 2005-2013 Shugo Maeda <shugo@ruby-lang.org> and Charlie Savage <cfis@savagexi.com>
   Please see the LICENSE file for copyright and distribution information */

#include "ruby_prof.h"

VALUE mMeasure;

prof_measurer_t* prof_get_measurer(prof_measure_mode_t measure)
{
    switch (measure) {
    case MEASURE_WALL_TIME:
        return prof_measurer_wall_time();
    case MEASURE_PROCESS_TIME:
        return prof_measurer_process_time();
    case MEASURE_CPU_TIME:
        return prof_measurer_cpu_time();
    case MEASURE_ALLOCATIONS:
        return prof_measurer_allocations();
    case MEASURE_MEMORY:
        return prof_measurer_memory();
    case MEASURE_GC_TIME:
        return prof_measurer_gc_time();
    case MEASURE_GC_RUNS:
        return prof_measurer_gc_runs();
    default:
        rb_raise(rb_eArgError, "Unknown measure mode: %d", measure);
    }
};

void rp_init_measure()
{
    mMeasure = rb_define_module_under(mProf, "Measure");
    rp_init_measure_wall_time();
    rp_init_measure_cpu_time();
    rp_init_measure_process_time();
    rp_init_measure_allocations();
    rp_init_measure_memory();
    rp_init_measure_gc_time();
    rp_init_measure_gc_runs();
}

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
ruby-prof-0.17.0 ext/ruby_prof/rp_measure.c
ruby-prof-0.16.2 ext/ruby_prof/rp_measure.c
ruby-prof-0.16.1 ext/ruby_prof/rp_measure.c
ruby-prof-0.16.0 ext/ruby_prof/rp_measure.c
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/ruby-prof-0.15.9/ext/ruby_prof/rp_measure.c
ruby-prof-0.15.9 ext/ruby_prof/rp_measure.c
ruby-prof-0.15.8 ext/ruby_prof/rp_measure.c
ruby-prof-0.15.7 ext/ruby_prof/rp_measure.c
ruby-prof-0.15.6 ext/ruby_prof/rp_measure.c
ruby-prof-0.15.5 ext/ruby_prof/rp_measure.c
ruby-prof-0.15.4 ext/ruby_prof/rp_measure.c