home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
fortran
/
library
/
whets
/
whets.for
/
_second.c
next >
Wrap
C/C++ Source or Header
|
1990-02-21
|
450b
|
25 lines
#include <sys/time.h>
#include <sys/resource.h>
float
second ()
{
struct rusage ru;
#ifdef MOXIE
static unsigned count = 0;
static unsigned stop;
extern unsigned __Argc;
extern char **__Argv;
if (count == 0 && __Argc > 1) {
stop = atoi(__Argv[__Argc-1]);
}
count += 1;
if (count == stop) exit(0);
#endif
getrusage (0, &ru);
return ((float)ru.ru_utime.tv_sec + ((float)ru.ru_utime.tv_usec / 1.0e6));
}