140865Sbostic /*- 262096Sbostic * Copyright (c) 1979, 1993 362096Sbostic * The Regents of the University of California. All rights reserved. 440865Sbostic * 540865Sbostic * %sccs.include.redist.c% 640865Sbostic */ 71699Smckusick 840865Sbostic #ifndef lint 9*67226Smckusick static char sccsid[] = "@(#)SCLCK.c 8.2 (Berkeley) 05/23/94"; 1040865Sbostic #endif /* not lint */ 111699Smckusick 12*67226Smckusick #include <sys/types.h> 1344647Smckusick #include <sys/time.h> 1444647Smckusick #include <sys/resource.h> 1544647Smckusick 163030Smckusic long SCLCK()171699SmckusickSCLCK() 181699Smckusick { 1944647Smckusick struct rusage ru; 201699Smckusick 2144647Smckusick if (getrusage(RUSAGE_SELF, &ru) < 0) 2244647Smckusick return (-1); 2344647Smckusick return (ru.ru_stime.tv_sec * 1000 + ru.ru_stime.tv_usec / 1000); 241699Smckusick } 25