ruby-prof/ruby-prof — pull request #137 by charliesome (2014-02-24 04:20:43+00:00)
Title: Fix CPU time measurement

`RubyProf::Measure::CpuTime.measure` is currently quite inefficient (it spends 500ms performing a bogomips-like estimation of CPU frequency) and inaccurate (CPU frequency is often dynamic these days).

This pull request changes it to use `getrusage` on non-Windows platforms.

Before:

```
λ time ruby -Ilib -rruby-prof -e 'puts RubyProf::Measure::CpuTime.measure'
17110.88256059947

real	0m0.562s
user	0m0.051s
sys	0m0.009s
```

After:

```
λ time ruby -Ilib -rruby-prof -e 'puts RubyProf::Measure::CpuTime.measure'
0.053457

real	0m0.059s
user	0m0.049s
sys	0m0.008s
```