Created
April 11, 2014 18:07
-
-
Save benweint/10488766 to your computer and use it in GitHub Desktop.
Demo of GC::Profiler.total time returning wrong units on JRuby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
t0 = Time.now | |
GC::Profiler.enable | |
100000.times do | |
String.new('a' * 1000) | |
end | |
gc_time = GC::Profiler.total_time | |
t1 = Time.now | |
puts "Elapsed time (s): #{t1 - t0}" | |
puts "GC time (s?): #{gc_time}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment