Skip to content

Instantly share code, notes, and snippets.

@benweint
Created April 11, 2014 18:07
Show Gist options
  • Save benweint/10488766 to your computer and use it in GitHub Desktop.
Save benweint/10488766 to your computer and use it in GitHub Desktop.
Demo of GC::Profiler.total time returning wrong units on JRuby
#!/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