140865Sbostic /*- 2*62096Sbostic * Copyright (c) 1979, 1993 3*62096Sbostic * The Regents of the University of California. All rights reserved. 440865Sbostic * 540865Sbostic * %sccs.include.redist.c% 640865Sbostic */ 71699Smckusick 840865Sbostic #ifndef lint 9*62096Sbostic static char sccsid[] = "@(#)SCLCK.c 8.1 (Berkeley) 06/06/93"; 1040865Sbostic #endif /* not lint */ 111699Smckusick 1244647Smckusick #include <sys/time.h> 1344647Smckusick #include <sys/resource.h> 1444647Smckusick 153030Smckusic long 161699Smckusick SCLCK() 171699Smckusick { 1844647Smckusick struct rusage ru; 191699Smckusick 2044647Smckusick if (getrusage(RUSAGE_SELF, &ru) < 0) 2144647Smckusick return (-1); 2244647Smckusick return (ru.ru_stime.tv_sec * 1000 + ru.ru_stime.tv_usec / 1000); 231699Smckusick } 24