Actions
Bug #663
closedBenchmark.measure outputs different result when executed using command line "ruby -e ..."
Description
=begin
I've tested it on :
- ruby 1.8.6 (2008-03-03 patchlevel 114) [i686-linux]
- ruby 1.8.5 (2006-08-25) [i386-linux]
Sorry, I've not tested it against 1.9 and 1.8.7.
[artem@dev bm_test]$ cat a.c
int main() {
int i = 0, k = 0, n = 1000000000;
for(i = 0 ; i< n; i++){ k += i*i; }
return k;
}
[artem@dev bm_test]$ make a
cc a.c -o a
[artem@dev bm_test]$ ruby -rbenchmark -e "puts Benchmark.measure{ ./a
}"
0.000000 0.000000 0.000000 ( 0.000011)
[artem@dev bm_test]$ echo 'puts Benchmark.measure{ ./a
}' > b.rb
[artem@dev bm_test]$ cat b.rb
puts Benchmark.measure{ ./a
}
[artem@dev bm_test]$ ruby -rbenchmark b.rb
0.000000 0.000000 4.660000 ( 4.652781)
Bugs:
- "ruby -e" : "total" is zero
- "ruby -e" : "real" is too small (should be ~ 4 seconds)
- "ruby" : "total" is not equal to "user" + "system" in the last example.
=end
Actions
Like0
Like0Like0Like0