home *** CD-ROM | disk | FTP | other *** search
- @node times, time
- @subheading Syntax
-
- @example
- #include <sys/times.h>
-
- clock_t times(struct tms *buf);
- @end example
-
- @subheading Description
-
- This function returns the number of clock ticks used by the current
- process and all of its children until the moment of call. The number
- of tics per second is @code{CLOCKS_PER_SEC}, defined on time.h.
-
- This is the structure in which @code{times} returns its info:
-
- @example
- struct tms @{
- clock_t tms_cstime;
- clock_t tms_cutime;
- clock_t tms_stime;
- clock_t tms_utime;
- @};
- @end example
-
- Currently, the elapsed time of the running program is returned in the
- @code{tms_utime} field, and all other fields return as zero.
-
- @subheading Return Value
-
- The number of elapsed tics since the program started.
-
- @subheading Example
-
- @example
- printf("We used %d seconds of elapsed time\n", times(&buf)/CLOCKS_PER_SEC);
- @end example
-
-