Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
GC.measure_total_time=
[T] (T enable) -> T
GC.measure_total_time = true/false
gc.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/gc.rb, line 364
def self.measure_total_time=(flag)
Primitive.cstmt! %{
rb_gc_impl_set_measure_total_time(rb_gc_get_objspace(), flag);
return flag;
}
end
Enables measuring GC time. You can get the result with GC.stat(:time). Note that GC time measurement can cause some performance overhead.