etime_.c File Reference

#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)


Define Documentation

#define _INCLUDE_POSIX_SOURCE

Definition at line 13 of file etime_.c.

#define _INCLUDE_XOPEN_SOURCE

Definition at line 14 of file etime_.c.

#define Hz   60

Definition at line 29 of file etime_.c.

#define REAL   double

Definition at line 9 of file etime_.c.


Function Documentation

REAL etime_ ( float *  tarray  ) 

Definition at line 37 of file etime_.c.

References Hz, and t.

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         }


Generated on Sun Mar 4 15:04:26 2007 for Scilab [trunk] by  doxygen 1.5.1