#include "time.h"#include "sys/types.h"#include "sys/times.h"Include dependency graph for etime_.c:

Go to the source code of this file.
Defines | |
| #define | REAL double |
| #define | _INCLUDE_POSIX_SOURCE |
| #define | _INCLUDE_XOPEN_SOURCE |
| #define | Hz 60 |
Functions | |
| REAL | etime_ (float *tarray) |
| REAL etime_ | ( | float * | tarray | ) |
Definition at line 37 of file etime_.c.
00039 { 00040 #ifdef USE_CLOCK 00041 #ifndef CLOCKS_PER_SECOND 00042 #define CLOCKS_PER_SECOND Hz 00043 #endif 00044 double t = clock(); 00045 tarray[1] = 0; 00046 return tarray[0] = (float)(t / CLOCKS_PER_SECOND); 00047 #else 00048 struct tms t; 00049 00050 times(&t); 00051 return (tarray[0] = (double)t.tms_utime/Hz) 00052 + (tarray[1] = (double)t.tms_stime/Hz); 00053 #endif 00054 }
1.5.1