From: "kosaki (Motohiro KOSAKI)" Date: 2012-12-03T12:29:17+09:00 Subject: [ruby-core:50503] [ruby-trunk - Bug #7500] Improve GC profiler timings on linux Issue #7500 has been updated by kosaki (Motohiro KOSAKI). And, if i understand the kernel source correctly, getrusage() and get_time(CLOCK_PROCESS_CPUTIME_ID) use the same clock source. So, I doubt this patch improve time accuracy. Do anyone have a test result? ---------------------------------------- Bug #7500: Improve GC profiler timings on linux https://bugs.ruby-lang.org/issues/7500#change-34342 Author: tmm1 (Aman Gupta) Status: Open Priority: Normal Assignee: authorNari (Narihiro Nakamura) Category: core Target version: 2.0.0 ruby -v: ruby 2.0.0dev (2012-12-03 trunk 38149) [x86_64-darwin12.2.0] On linux kernels, getrusage()'s precision depends on the value of HZ when the kernel was compiled. By default, HZ=250 provides a 4ms granularity. This patch uses clock_gettime() with CLOCK_PROCESS_CPUTIME_ID when available, which provides a 1ns precision on linux. -- http://bugs.ruby-lang.org/