Dip  0.92.4
Macros | Functions
sym_timemeas.h File Reference
#include <sys/time.h>
#include "sym_proto.h"
Include dependency graph for sym_timemeas.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PRINT_TIME(tm, f)
 
#define PRINT_TIME2(tm, f)
 
#define TVCLEAR(tvp)   (tvp.tv_sec = tvp.tv_usec = 0)
 
#define PTVCLEAR(tvp)   ((tvp)->tv_sec = (tvp)->tv_usec = 0)
 
#define TVISSET(tvp)   (tvp.tv_sec || tvp.tv_usec)
 
#define PTVISSET(tvp)   ((tvp)->tv_sec || (tvp)->tv_usec)
 
#define TVXLTY(xtv, ytv)
 
#define PTVXLTY(xtv, ytv)
 
#define TVXADDY(ztv, xtv, ytv)
 
#define PTVXADDY(ztv, xtv, ytv)
 
#define TVXSUBY(ztv, xtv, ytv)
 
#define PTVXSUBY(ztv, xtv, ytv)
 
#define TVTODBL(tvp)   ((double)tvp.tv_sec + ((double)tvp.tv_usec)/1000000 )
 
#define TVPTODBL(tvp)   ((double)(tvp)->tv_sec+((double)(tvp)->tv_usec)/1000000)
 
#define DBLTOTV(x, tv)
 
#define DBLTOPTV(x, tvp)
 

Functions

void start_time PROTO ((void))
 
double used_time PROTO ((double *T))
 

Macro Definition Documentation

#define PRINT_TIME (   tm,
 
)
Value:
{ /* Print the elapsed time in vbctool format*/ \
double elapsed = wall_clock(NULL) - tm->start_time; \
int hours, minutes, seconds, msec; \
hours = (int)(elapsed/3600.0); \
elapsed -= hours*3600.0; \
minutes = (int)(elapsed/60.0); \
elapsed -= minutes*60.0; \
seconds = (int)elapsed; \
elapsed -= (double)seconds; \
msec = (int)(elapsed*100.0); \
fprintf(f, "%.2d:%.2d:%.2d:%.2d ", hours, minutes, seconds, msec); \
}

Definition at line 30 of file sym_timemeas.h.

#define PRINT_TIME2 (   tm,
 
)
Value:
{ /* Print the elapsed time in vbctool format*/ \
double elapsed_t = wall_clock(NULL) - tm->start_time; \
fprintf(f, "%10.6f ", elapsed_t); \
}

Definition at line 44 of file sym_timemeas.h.

#define TVCLEAR (   tvp)    (tvp.tv_sec = tvp.tv_usec = 0)

Definition at line 49 of file sym_timemeas.h.

#define PTVCLEAR (   tvp)    ((tvp)->tv_sec = (tvp)->tv_usec = 0)

Definition at line 50 of file sym_timemeas.h.

#define TVISSET (   tvp)    (tvp.tv_sec || tvp.tv_usec)

Definition at line 52 of file sym_timemeas.h.

#define PTVISSET (   tvp)    ((tvp)->tv_sec || (tvp)->tv_usec)

Definition at line 53 of file sym_timemeas.h.

#define TVXLTY (   xtv,
  ytv 
)
Value:
( (xtv.tv_sec < ytv.tv_sec) || \
(xtv.tv_sec == ytv.tv_sec && xtv.tv_usec < ytv.tv_usec))

Definition at line 55 of file sym_timemeas.h.

#define PTVXLTY (   xtv,
  ytv 
)
Value:
( ((xtv)->tv_sec < (ytv)->tv_sec) || \
((xtv)->tv_sec == (ytv)->tv_sec && (xtv)->tv_usec < (ytv)->tv_usec))

Definition at line 58 of file sym_timemeas.h.

#define TVXADDY (   ztv,
  xtv,
  ytv 
)
Value:
if ((ztv.tv_usec = xtv.tv_usec + ytv.tv_usec) < 1000000) { \
ztv.tv_sec = xtv.tv_sec + ytv.tv_sec; \
} else { \
ztv.tv_usec -= 1000000; \
ztv.tv_sec = xtv.tv_sec + ytv.tv_sec + 1; \
}

Definition at line 62 of file sym_timemeas.h.

#define PTVXADDY (   ztv,
  xtv,
  ytv 
)
Value:
if (((ztv)->tv_usec = (xtv)->tv_usec + (ytv)->tv_usec) < 1000000) { \
(ztv)->tv_sec = (xtv)->tv_sec + (ytv)->tv_sec; \
} else { \
(ztv)->tv_usec -= 1000000; \
(ztv)->tv_sec = (xtv)->tv_sec + (ytv)->tv_sec + 1; \
}

Definition at line 69 of file sym_timemeas.h.

#define TVXSUBY (   ztv,
  xtv,
  ytv 
)
Value:
if (xtv.tv_usec >= ytv.tv_usec) { \
ztv.tv_sec = xtv.tv_sec - ytv.tv_sec; \
ztv.tv_usec = xtv.tv_usec - ytv.tv_usec; \
} else { \
ztv.tv_sec = xtv.tv_sec - ytv.tv_sec - 1; \
ztv.tv_usec = xtv.tv_usec + 1000000 - ytv.tv_usec; \
}

Definition at line 77 of file sym_timemeas.h.

#define PTVXSUBY (   ztv,
  xtv,
  ytv 
)
Value:
if ((xtv)->tv_usec >= (ytv)->tv_usec) { \
(ztv)->tv_sec = (xtv)->tv_sec - (ytv)->tv_sec; \
(ztv)->tv_usec = (xtv)->tv_usec - (ytv)->tv_usec; \
} else { \
(ztv)->tv_sec = (xtv)->tv_sec - (ytv)->tv_sec - 1; \
(ztv)->tv_usec = (xtv)->tv_usec + 1000000 - (ytv)->tv_usec; \
}

Definition at line 85 of file sym_timemeas.h.

#define TVTODBL (   tvp)    ((double)tvp.tv_sec + ((double)tvp.tv_usec)/1000000 )

Definition at line 94 of file sym_timemeas.h.

#define TVPTODBL (   tvp)    ((double)(tvp)->tv_sec+((double)(tvp)->tv_usec)/1000000)

Definition at line 95 of file sym_timemeas.h.

#define DBLTOTV (   x,
  tv 
)
Value:
tv.tv_sec = (int) floor(x); \
tv.tv_usec = (int) floor(1000000 * (x - (double)tv.tv_sec));

Definition at line 97 of file sym_timemeas.h.

#define DBLTOPTV (   x,
  tvp 
)
Value:
(tvp)->tv_sec = (int) floor(x); \
(tvp)->tv_usec = (int) floor(1000000 * (x - (tvp)->tv_sec));

Definition at line 100 of file sym_timemeas.h.

Function Documentation

void start_time PROTO ( (void)  )
double wall_clock PROTO ( (double *T)  )