blob: 5acf671aef1f5a2669d07c681d38ca7269d0f24e [file] [log] [blame]
rsccfa37a72004-04-10 18:53:55 +00001.TH CPUTIME 3
2.SH NAME
3cputime, times \- cpu time in this process and children
4.SH SYNOPSIS
5.B #include <u.h>
6.br
7.B #include <libc.h>
8.PP
9.ta \w'\fLdouble 'u
10.B
11int times(long t[4])
12.PP
13.B
14double cputime(void)
15.SH DESCRIPTION
16If
17.I t
18is non-null,
19.I times
20fills it in
21with the number of milliseconds spent in user code, system calls,
22child processes in user code, and child processes in system calls.
23.I Cputime
24returns the sum of those same times, converted to seconds.
25.I Times
26returns the elapsed real time, in milliseconds, that the process has been running.
27.PP
28These functions read
29.BR /dev/cputime ,
30opening that file when they are first called.
31.SH SOURCE
rscb5fdffe2004-04-19 19:22:56 +000032.B /usr/local/plan9/src/libc/9sys
rsccfa37a72004-04-10 18:53:55 +000033.SH SEE ALSO
34.IR cons (3)