1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
|
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Modified by Michael Haardt (michael@moria.de)
.\" Modified Sat Jul 24 14:29:17 1993 by Rik Faith (faith@cs.unc.edu)
.\" Modified 961203 and 001211 and 010326 by aeb@cwi.nl
.\" Modified 001213 by Michael Haardt (michael@moria.de)
.\" Modified 13 Jun 02, Michael Kerrisk <mtk-manpages@gmx.net>
.\" Added note on non-standard behaviour when SIGCHLD is ignored.
.\" Modified 2004-11-16, mtk, Noted that the non-conformance when
.\" SIGCHLD is being ignored is fixed in 2.6.9; other minor changes
.\" Modified 2004-12-08, mtk, in 2.6 times() return value changed
.\" 2005-04-13, mtk
.\" Added notes on non-standard behaviour: Linux allows 'buf' to
.\" be NULL, but POSIX.1 doesn't specify this and it's non-portable.
.\"
.\" Japanese Version Copyright (c) 1996 Satoshi Nozawa
.\" all rights reserved.
.\" Translated 1996-06-25, Satoshi I. Nozawa <snozawa@env.sci.ibaraki.ac.jp>
.\" Modified 1997-12-14, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Updated 2001-02-16, Kentaro Shirakata <argrath@ub32.org>
.\" Updated 2001-04-10, Kentaro Shirakata <argrath@ub32.org>
.\" Updated 2001-05-21, Kentaro Shirakata <argrath@ub32.org>
.\" Updated 2002-10-21, Kentaro Shirakata <argrath@ub32.org>
.\" Updated 2005-02-24, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
.\" Updated 2005-04-20, Kentaro Shirakata <argrath@ub32.org>
.\"
.\" WORD: clock ticks å
.\"
.TH TIMES 2 2002-06-14 "Linux" "Linux Programmer's Manual"
.SH ̾
times - ץ֤
.SH
.B #include <sys/times.h>
.sp
.BI "clock_t times(struct tms *" buf );
.SH
.BR times ()
ϸߤΥץ֤
.I buf
ؤƤ
.B "struct tms"
˳Ǽ롣
.I struct tms
.I <sys/times.h>
ǰʲΤ褦Ƥ:
.sp
.nf
struct tms {
.RS
clock_t tms_utime; /* user time */
clock_t tms_stime; /* system time */
clock_t tms_cutime; /* user time of children */
clock_t tms_cstime; /* system time of children */
.RE
};
.fi
.LP
.I tms_utime
եɤϡƤӽФץ̿¹ԤΤ˾
CPU ֤Ǥ롣
.I tms_stime
եɤϡƤӽФץΤ˼¹Ԥ줿ǡ
ƥब CPU ֤Ǥ롣
.I tms_cutime
եɤϡ
λԤäƤƤλҥץ
.I tms_utime
.I tms_cutime
ιפǤ롣
.I tms_cstime
եɤϡ
λԤäƤƤλҥץ
.I tms_stime
.I tms_cstime
ιפǤ롣
.LP
λ(ڤӤλ¹)ץλ֤
.BR wait (2)
.BR waitpid (2)
ץ ID ִ֤֤˲û롣
ĤޤꡢҤޤλԤäƤʤ֤Ǥ
¹ץλ֤Ϸ褷Ƹʤ
.LP
Ƥλ֤ϥå֤롣
.SH ֤
.BR times ()
ϲΤвᤷå (clock tick) ֤
Linux 2.4 ȤΥСǤϡΡ֤פȤ
ƥबưִ֤Ǥ롣
Linux 2.6 ϡΡ֤פϥƥ൯ư
\fI(2^32/HZ) \- 300\fP (褽 42900) Ȥʤ롣
֤ͤ
.I clock_t
ϰϤ饪Сե뤫⤷ʤ
顼ξ硢\fI(clock_t) \-1\fP ֤졢
.I errno
Ŭڤꤵ롣
.SH
äΥå
.RS
sysconf(_SC_CLK_TCK);
.RE
Ȥä뤳Ȥ롣
POSIX-1996 ǤϡCLK_TCK ܥ
.RI ( <time.h>
Ƥ) ϸŤΤǤȵҤƤ롣
ǤϤϸŤΤǤ롣
.PP
Linux 2.6.9 ΥСǤϡ
.B SIGCHLD
.B SIG_IGN
ꤹ
λҥץβ
ưŪ
.I tms_cstime
.I tms_cutime
եɤ˴ޤޤ롣
POSIX.1-2001 ǤϡưϸƤӽФ
.BR wait ()
ؿǻҥץԤäˤΤߵ٤ȤƤ롣
ɸȤϰۤʤ뤳ư Linux 2.6.9 ʹߤǽƤ롣
.\" See the description of times() in XSH, which says:
.\" The times of a terminated child process are included... when wait()
.\" or waitpid() returns the process ID of this terminated child.
Linux Ǥϡ
.I buf
NULL ꤹ뤳ȤǤξ
.BR times ()
ñ˴ؿη̤֤
POSIX ϤοϵꤵƤ餺
¾ΤۤȤɤ Unix
.I buf
ͤȤ NULL ᤹ͤ롣
.LP
.BR clock (3)
.I clock_t
֤ͤϥåǤϤʤ
.B CLOCKS_PER_SEC
ñ̤Ǥդ뤳ȡ
.SH
SVr4, 4.3BSD, POSIX.1-2001.
.SH
SVr1-3 Ǥ
.I long
֤¤ΤΥФ
.I time_t
ȤäƤÿǤϤʤåǼƤ
V7 ǤϹ¤ΤΥФ
.I long
ȤäƤޤ
.I time_t
ʤäǤ롣
.PP
ŤƥǤϰäΥå HZ ѿͿ롣
.SH Ϣ
.BR time (1),
.BR getrusage (2),
.BR wait (2),
.BR clock (3),
.BR sysconf (3),
.BR time (7)
|