dtime_.c File Reference

#include "time.h"
#include "sys/types.h"
#include "sys/times.h"

Include dependency graph for dtime_.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 dtime_ (float *tarray)


Define Documentation

#define _INCLUDE_POSIX_SOURCE

Definition at line 13 of file dtime_.c.

#define _INCLUDE_XOPEN_SOURCE

Definition at line 14 of file dtime_.c.

#define Hz   60

Definition at line 29 of file dtime_.c.

Referenced by dtime_(), and etime_().

#define REAL   double

Definition at line 9 of file dtime_.c.

Referenced by C2F(), CreDIMFOREXT(), GetPOLYNOM(), OutPOLYNOM(), spPartition(), spSetReal(), WriteCallConvertion(), WriteCallRest(), and WriteVariableOutput().


Function Documentation

REAL dtime_ ( float *  tarray  ) 

Definition at line 37 of file dtime_.c.

References Hz, t, and t0.

00039 {
00040 #ifdef USE_CLOCK
00041 #ifndef CLOCKS_PER_SECOND
00042 #define CLOCKS_PER_SECOND Hz
00043 #endif
00044         static double t0;
00045         double t = clock();
00046         tarray[1] = 0;
00047         tarray[0] = (float) ( (t - t0) / CLOCKS_PER_SECOND);
00048         t0 = t;
00049         return tarray[0];
00050 #else
00051         struct tms t;
00052         static struct tms t0;
00053 
00054         times(&t);
00055         tarray[0] = (double)(t.tms_utime - t0.tms_utime) / Hz;
00056         tarray[1] = (double)(t.tms_stime - t0.tms_stime) / Hz;
00057         t0 = t;
00058         return tarray[0] + tarray[1];
00059 #endif
00060         }


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