This preview shows page 1. Sign up to view the full content.
Unformatted text preview: to 2.49 seconds, less than half of the elapsed time of 6.52 seconds, indicating that the processor was executing other processes at the same time. The percentage indicates what fraction the combined user and system times were of the elapsed time, e.g., ´¾ ¾¿ · ¼ ¾ µ ¾ ¼ ¿ ½. The remaining statistics summarize the paging and I/O behavior. Programmers can also read the process timers by calling the library function times, declared as follows:
#include <sys/times.h> struct tms clock t clock t clock t clock t ; tms tms tms tms utime; /* user time */ stime; /* system time */ cutime; /* user time of reaped children */ cstime; /* system time of reaped children */ clock t times(struct tms *buf);
Returns: number of clock ticks elapsed since system started 9.2. MEASURING TIME BY INTERVAL COUNTING 457 These time measurements are expressed in terms of a unit called clock ticks. The deﬁned constant CLK TCK speciﬁes the number of clock ticks per second. The data type clock t is typically deﬁned to be a long integer. The ﬁelds ind...
View Full Document