1
0
Files
irix-657m-src/eoe/man/man3c/clock.3c
2022-09-29 17:59:04 +03:00

54 lines
1.5 KiB
Plaintext

'\"macro stdmacro
.if n .pH g3c.clock @(#)clock 30.2 of 12/25/85
.nr X
.if \nX=0 .ds x} CLOCK 3C "C Programming Language Utilities" "\&"
.if \nX=1 .ds x} CLOCK 3C "C Programming Language Utilities"
.if \nX=2 .ds x} CLOCK 3C "" "\&"
.if \nX=3 .ds x} CLOCK "" "" "\&"
.TH \*(x}
.SH NAME
clock \- report CPU time used
.SH SYNOPSIS
.B #include <time.h>
.PP
.B clock_t clock (void);
.SH DESCRIPTION
.I clock\^
returns the amount of CPU time used since the
first call to
.IR clock .
The unit time of clock (microseconds) is indicated in
the macro CLOCKS_PER_SEC found
in the file
.IR <time.h> .
The time reported is the sum of the user and system times of the
calling process and its terminated child processes for which it has executed
.IR wait (2),
.IR pclose (3S),
or
.IR system (3S).
.PP
The resolution of the clock is 10 milliseconds on IRIS workstations.
.SH SEE ALSO
times(2), wait(2), popen(3S), system(3S).
.SH BUGS
The implementation of
.I clock\^
conflicts with the definition of the routine found in
the ANSI C Standard. The discrepancy will be transparent, however,
so long as programs which adhere to that Standard use
the difference in two invocations of
.I clock\^
for timing information, as recommended by the Standard.
.PP
The value returned by
.I clock\^
is defined in microseconds for compatibility with systems that have
CPU clocks with much higher resolution.
Because of this, the value returned
will wrap around after accumulating
only 2147 seconds of CPU time (about 36 minutes).
'\".so /pubs/tools/origin.att
.\" @(#)clock.3c 6.2 of 10/20/83
.Ee