xref: /csrg-svn/usr.bin/pascal/libpc/CLCK.c (revision 62092)
140865Sbostic /*-
2*62092Sbostic  * Copyright (c) 1979, 1993
3*62092Sbostic  *	The Regents of the University of California.  All rights reserved.
440865Sbostic  *
540865Sbostic  * %sccs.include.redist.c%
640865Sbostic  */
71643Smckusick 
840865Sbostic #ifndef lint
9*62092Sbostic static char sccsid[] = "@(#)CLCK.c	8.1 (Berkeley) 06/06/93";
1040865Sbostic #endif /* not lint */
111643Smckusick 
1244647Smckusick #include <sys/time.h>
1344647Smckusick #include <sys/resource.h>
1444647Smckusick 
152998Smckusic long
161643Smckusick CLCK()
171643Smckusick {
1844647Smckusick 	struct rusage ru;
191643Smckusick 
2044647Smckusick 	if (getrusage(RUSAGE_SELF, &ru) < 0)
2144647Smckusick 		return (-1);
2244647Smckusick 	return (ru.ru_utime.tv_sec * 1000 + ru.ru_utime.tv_usec / 1000);
231643Smckusick }
24