9103 opengroup acknowledgement should be properly formatted in man pages
[unleashed.git] / usr / src / man / man3c / clock.3c
blob602f80e3d00b531c2c495bf386ded3f5b6214b86
1 '\" te
2 .\"  Copyright 1989 AT&T  Copyright (c) 2002, Sun Microsystems, Inc.  All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH CLOCK 3C "Jul 24, 2002"
7 .SH NAME
8 clock \- report CPU time used
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <time.h>
14 \fBclock_t\fR \fBclock\fR(\fBvoid\fR);
15 .fi
17 .SH DESCRIPTION
18 .sp
19 .LP
20 The \fBclock()\fR function returns the amount of CPU time (in microseconds)
21 used since the first call to \fBclock()\fR in the calling process. The time
22 reported is the sum of the user and system times of the calling process and its
23 terminated child processes for which it has executed the \fBwait\fR(3C)
24 function, the \fBpclose\fR(3C) function, or the \fBsystem\fR(3C) function.
25 .SH RETURN VALUES
26 .sp
27 .LP
28 Dividing the value returned by \fBclock()\fR by the constant
29 \fBCLOCKS_PER_SEC\fR, defined in the <\fBtime.h\fR> header, will give the time
30 in seconds.  If the process time used is not available or cannot be
31 represented, clock returns the value \fB(clock_t) \(mi1\fR.
32 .SH USAGE
33 .sp
34 .LP
35 The value returned by \fBclock()\fR is defined in microseconds for
36 compatibility with systems that have CPU clocks with much higher resolution.
37 Because of this, the value returned will wrap around after accumulating only
38 2147 seconds of CPU time (about 36 minutes).
39 .SH ATTRIBUTES
40 .sp
41 .LP
42 See \fBattributes\fR(5) for descriptions of the following attributes:
43 .sp
45 .sp
46 .TS
47 box;
48 c | c
49 l | l .
50 ATTRIBUTE TYPE  ATTRIBUTE VALUE
52 Interface Stability     Standard
54 MT-Level        MT-Safe
55 .TE
57 .SH SEE ALSO
58 .sp
59 .LP
60 \fBtimes\fR(2), \fBpopen\fR(3C), \fBsystem\fR(3C), \fBwait\fR(3C),
61 \fBattributes\fR(5), \fBstandards\fR(5)