
Click above to get retro games delivered to your door ever month!
X-Hacker.org- libc - <b>times</b>
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
times
=====
Syntax
------
#include <sys/times.h>
clock_t times(struct tms *buf);
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 `CLOCKS_PER_SEC', defined on time.h.
This is the structure in which `times' returns its info:
struct tms {
clock_t tms_cstime;
clock_t tms_cutime;
clock_t tms_stime;
clock_t tms_utime;
};
Currently, the elapsed time of the running program is returned in the
`tms_utime' field, and all other fields return as zero.
Return Value
------------
The number of elapsed tics since the program started.
Example
-------
printf("We used %d seconds of elapsed time\n", times(&buf)/CLOCKS_PER_SEC);
Online resources provided by: http://www.ousob.com --- NG 2 HTML conversion by Dave Pearson