Class: Lens::GC
- Inherits:
-
Object
- Object
- Lens::GC
- Defined in:
- lib/lens/gc.rb,
lib/lens/gc.rb
Instance Method Summary collapse
- #enable ⇒ Object
-
#initialize ⇒ GC
constructor
A new instance of GC.
- #total_time ⇒ Object
Constructor Details
#initialize ⇒ GC
Returns a new instance of GC.
4 5 6 |
# File 'lib/lens/gc.rb', line 4 def initialize @total = 0 end |
Instance Method Details
#enable ⇒ Object
8 9 10 |
# File 'lib/lens/gc.rb', line 8 def enable ::GC::Profiler.enable end |
#total_time ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/lens/gc.rb', line 12 def total_time run = ::GC::Profiler.total_time if run > 0 ::GC::Profiler.clear end @total += run end |