xref: /csrg-svn/usr.bin/pascal/libpc/CLCK.c (revision 67225)
140865Sbostic /*-
262092Sbostic  * Copyright (c) 1979, 1993
362092Sbostic  *	The Regents of the University of California.  All rights reserved.
440865Sbostic  *
540865Sbostic  * %sccs.include.redist.c%
640865Sbostic  */
71643Smckusick 
840865Sbostic #ifndef lint
9*67225Smckusick static char sccsid[] = "@(#)CLCK.c	8.2 (Berkeley) 05/23/94";
1040865Sbostic #endif /* not lint */
111643Smckusick 
12*67225Smckusick #include <sys/types.h>
1344647Smckusick #include <sys/time.h>
1444647Smckusick #include <sys/resource.h>
1544647Smckusick 
162998Smckusic long
CLCK()171643Smckusick CLCK()
181643Smckusick {
1944647Smckusick 	struct rusage ru;
201643Smckusick 
2144647Smckusick 	if (getrusage(RUSAGE_SELF, &ru) < 0)
2244647Smckusick 		return (-1);
2344647Smckusick 	return (ru.ru_utime.tv_sec * 1000 + ru.ru_utime.tv_usec / 1000);
241643Smckusick }
25