move benchmarks to their own dir.
[minix.git] / lib / syslib / sys_times.c
blob68982489f90cdb1193939d2d08960ad3d90e8e58
1 #include "syslib.h"
3 PUBLIC int sys_times(proc_ep, user_time, sys_time, uptime, boottime)
4 endpoint_t proc_ep; /* proc_ep whose times are needed */
5 clock_t *user_time; /* time spend in the process itself */
6 clock_t *sys_time; /* time spend in system on behalf of the
7 * process
8 */
9 clock_t *uptime; /* time the system is running */
10 time_t *boottime; /* boot time */
12 /* Fetch the accounting info for a proc_ep. */
13 message m;
14 int r;
16 m.T_ENDPT = proc_ep;
17 r = _taskcall(SYSTASK, SYS_TIMES, &m);
18 if (user_time) *user_time = m.T_USER_TIME;
19 if (sys_time) *sys_time = m.T_SYSTEM_TIME;
20 if (uptime) *uptime = m.T_BOOT_TICKS;
21 if (boottime) *boottime = m.T_BOOTTIME;
22 return(r);