Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method · added in Ruby 3.1
GC.measure_total_time
() -> bool
GC.measure_total_time → true or false
gc.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/gc.rb, line 645
def self.measure_total_time
Primitive.cexpr! %{
RBOOL(rb_gc_impl_get_measure_total_time(rb_gc_get_objspace()))
}
end
Returns the setting for GC total time measurement in the current Ractor; the main Ractor’s initial setting is true and, with the default GC, other Ractors inherit their creator’s setting. See GC.total_time.
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.0 · 3.4 · 3.3 · 3.2 · 3.1