Permalink
Browse files

update README

  • Loading branch information...
1 parent 6ce45b8 commit bde6a68fde8bc66381f5080dfbb9ddb4c2c540dd @tmm1 committed Sep 21, 2012
Showing with 25 additions and 22 deletions.
  1. +25 −22 README.md
View
@@ -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

0 comments on commit bde6a68

Please sign in to comment.