develooper Front page | perl.perl5.porters | Postings from March 2006

child's processor time

Thread Next
From:
hv
Date:
March 29, 2006 04:25
Subject:
child's processor time
Message ID:
200603291234.k2TCY6r29535@zen.crypt.org
The docs don't make clear that cutime and cstime include times only for
terminated children, ie that you can't use times() to get "time so far"
for a running child.

The patch below mentions that, assuming it is the same across all systems.
My times(2) manpage is more explicit: they include children that have
"terminated and been wait(2)ed for" (and in particular, time taken by a
grandchild will never be included if its parent did not wait for it before
itself terminating), but I'm not sure how that translates to perl externals
or whether it can usefully be documented.

I didn't know this: I was trying to write a test harness that would be
able to warn of individually slow tests. Is there a way to get a child's
current utime? If there is, the patch below should also be extended to
reflect that.

Hugo
--- perlfunc.pod.old	Tue Mar 14 17:05:21 2006
+++ perlfunc.pod	Wed Mar 29 13:26:01 2006
@@ -6465,6 +6465,8 @@
 
 In scalar context, C<times> returns C<$user>.
 
+Note that times for children are included only after they terminate.
+
 =item tr///
 
 The transliteration operator.  Same as C<y///>.  See L<perlop>.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About