Sha256: 998b4ab0940084691a3362861fe7fb852a269c7ebc140c815145b9d109666a1c

Contents?: true

Size: 1.24 KB

Versions: 12

Compression:

Stored size: 1.24 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_ALLOCATIONS:
      return prof_measurer_allocations();
      break;
    case MEASURE_CPU_TIME:
      return prof_measurer_cpu_time();
      break;
    case MEASURE_GC_RUNS:
      return prof_measurer_gc_runs();
      break;
    case MEASURE_GC_TIME:
      return prof_measurer_gc_time();
      break;
    case MEASURE_MEMORY:
      return prof_measurer_memory();
      break;
    case MEASURE_PROCESS_TIME:
      return prof_measurer_process_time();
      break;
    case MEASURE_WALL_TIME:
      return prof_measurer_wall_time();
      break;
	default:
	  rb_raise(rb_eArgError, "Unknown measure mode: %d", measure);
    }
};

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ruby-prof-0.15.3 ext/ruby_prof/rp_measure.c
ruby-prof-0.15.2 ext/ruby_prof/rp_measure.c
ruby-prof-0.15.1 ext/ruby_prof/rp_measure.c
ruby-prof-0.15.0 ext/ruby_prof/rp_measure.c
ruby-prof-0.14.2 ext/ruby_prof/rp_measure.c
ruby-prof-0.14.1 ext/ruby_prof/rp_measure.c
ruby-prof-0.14.0 ext/ruby_prof/rp_measure.c
ruby-prof-0.13.1 ext/ruby_prof/rp_measure.c
ruby-prof-0.13.0 ext/ruby_prof/rp_measure.c
ruby-prof-0.12.2 ext/ruby_prof/rp_measure.c
ruby-prof-0.12.1-x86-mingw32 ext/ruby_prof/rp_measure.c
ruby-prof-0.12.1 ext/ruby_prof/rp_measure.c