Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm1 committed Sep 21, 2012
1 parent 6ce45b8 commit bde6a68
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,31 @@
% ruby -C ext extconf.rb
% make -C ext
% ruby test.rb
| $:.unshift 'ext'
| require 'rblineprof'
|
| profile = lineprof(/./) do
1 | 1000.times do
|
410 | 1*2*3
441 | 4*5*6
1243 | 7*8*9*10*11*12*13*14*15
380 | 2**32
1115 | 2**128
|
| end
| end
|
| File.readlines(__FILE__).each_with_index do |line, num|
| if (sample = profile[__FILE__][num+1]) > 0
| printf "% 6d | %s", sample, line
| else
| printf " | %s", line
| end
| end
| $:.unshift 'ext'
| require 'rblineprof'
|
| profile = lineprof(/./) do
1.2ms | sleep 0.001
|
0.1ms | 100.times do
|
119.6ms | sleep 0.001
0.7ms | 1*2*3
0.2ms | 4*5*6
0.4ms | 7*8*9*10*11*12*13*14*15
0.2ms | 2**32
1.4ms | 2**128
|
| end
| end
|
| File.readlines(__FILE__).each_with_index do |line, num|
| if (sample = profile[__FILE__][num+1]) > 0
| printf "% 8.1fms | %s", sample/1000.0, line
| else
| printf " | %s", line
| end
| end
```

## Other profilers
Expand Down

0 comments on commit bde6a68

Please sign in to comment.