Bug #4581
Documentation for Process.times is outdated
Description
=begin
The code sample for Process.times only mentions utime and stime, even though there's cutime and sctime as well. There's also a reference to "page 388", presumably of the first edition of the Pickaxe. Should that be updated or deleted?
=end
Updated by nagachika (Tomoyuki Chikanaga) over 9 years ago
- Category set to doc
- Assignee set to nagachika (Tomoyuki Chikanaga)
Hi,
Thank you for your reporting this.
I wrote a tiny patch. I'll check in this later.
Any corrections are welcome :)
diff --git a/process.c b/process.c
index 24e7bf9..6699484 100644
--- a/process.c
+++ b/process.c
@@ -5611,12 +5611,12 @@ p_gid_switch(VALUE obj)
- call-seq:
- Process.times -> aStructTms
*
- * Returns a Tms structure (see Struct::Tms
- * on page 388) that contains user and system CPU times for this
- * process.
- * Returns a Tms structure (see Struct::Tms)
- * that contains user and system CPU times for this process,
- * and also for children processes. *
- t = Process.times
- * [ t.utime, t.stime ] #=> [0.0, 0.02]
- * [ t.utime, t.stime, t.cutime, t.cstime ] #=> [0.0, 0.02, 0.00, 0.00] */
VALUE
Updated by nagachika (Tomoyuki Chikanaga) over 9 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r31564.
Andrew, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- process.c (rb_proc_times): improve documentation. [ruby-core:35785] fixes #4581, reported by Andrew Grimm.