ack/lang/cem/libcc.ansi/time/clock.c

20 lines
311 B
C
Raw Normal View History

1989-06-12 15:22:14 +00:00
/*
* 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);
}