End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method · added in Ruby 3.1
GC.measure_total_time
GC.measure_total_time → true/false
gc.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/gc.rb, line 288
def self.measure_total_time
Primitive.cexpr! %{
RBOOL(rb_objspace.flags.measure_gc)
}
end
Return measure_total_time flag (default: true). Note that measurement can affect the application performance.
Ruby version changes
-
3.1
-
“GC.measure_total_time = true” enables the measurement of
GC. Measurement can introduce overhead. It is enabled by default.GC.measure_total_timereturns the current setting.GC.stat[:time] orGC.stat(:time) returns measured time in milli-seconds. [[Feature #10917]]
-
See also
.measure_total_time=
.malloc_allocations
.malloc_allocated_size
.remove_stress_to_class
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2