1 /* NetWare can not use this implementation of clock, since it does not
2 have times or any similar function. It provides its own version of
3 clock in clib.nlm. If we can not use clib.nlm, then we must write
4 clock in sys/netware. */
14 * Original Author: G. Haley
16 * Determines the processor time used by the program since invocation. The time
17 * in seconds is the value returned divided by the value of the macro CLK_TCK.
18 * If the processor time used is not available, (clock_t) -1 is returned.
23 <<clock>>---cumulative processor time
33 Calculates the best available approximation of the cumulative amount
34 of time used by your program since it started. To convert the result
35 into seconds, divide by the macro <<CLOCKS_PER_SEC>>.
38 The amount of processor time used so far by your program, in units
39 defined by the machine-dependent macro <<CLOCKS_PER_SEC>>. If no
40 measurement is available, the result is (clock_t)<<-1>>.
43 ANSI C requires <<clock>> and <<CLOCKS_PER_SEC>>.
45 Supporting OS subroutine required: <<times>>.
49 #include <sys/times.h>
58 if ((res
= (clock_t) _times_r (_REENT
, &tim_s
)) != (clock_t) -1)
59 res
= (clock_t) (tim_s
.tms_utime
+ tim_s
.tms_stime
+
60 tim_s
.tms_cutime
+ tim_s
.tms_cstime
);
65 #endif /* CLOCK_PROVIDED */