Class: Skylight::VM::GC Private
- Defined in:
- lib/skylight/vm/gc.rb,
lib/skylight/vm/gc.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #enable ⇒ Object private
-
#initialize ⇒ GC
constructor
private
A new instance of GC.
- #total_time ⇒ Object private
Constructor Details
#initialize ⇒ GC
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of GC.
34 35 36 |
# File 'lib/skylight/vm/gc.rb', line 34 def initialize @total = 0 end |
Instance Method Details
#enable ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
38 39 40 |
# File 'lib/skylight/vm/gc.rb', line 38 def enable ::GC::Profiler.enable end |
#total_time ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/skylight/vm/gc.rb', line 42 def total_time # Reported in seconds run = (::GC::Profiler.total_time * 1_000_000).to_i if run > 0 ::GC::Profiler.clear end @total += run end |