ack/lang/cem/libcc.ansi/time/clock.c
1989-06-12 15:22:14 +00:00

20 lines
311 B
C

/*
* clock - determine the processor time used
*/
/* $Header$ */
#include <time.h>
#include <sys/time.h>
#include <sys/resource.h>
clock_t
clock(void)
{
struct rusage rusage;
getrusage(RUSAGE_SELF, &rusage);
return (((unsigned long)rusage.ru_utime.tv_sec * CLK_TCK)
+ rusage.ru_utime.tv_usec);
}