PIPS
pyps_gettime.h File Reference
#include <sys/time.h>
+ Include dependency graph for pyps_gettime.h:

Go to the source code of this file.

Functions

void __pyps_bench_start (struct timeval *timestart)
 
void __pyps_bench_stop (const char *module, const struct timeval *timestart)
 

Function Documentation

◆ __pyps_bench_start()

void __pyps_bench_start ( struct timeval *  timestart)

Definition at line 11 of file pyps_gettime.c.

12 {
13  gettimeofday(timestart, NULL);
14 }

◆ __pyps_bench_stop()

void __pyps_bench_stop ( const char *  module,
const struct timeval *  timestart 
)

Definition at line 16 of file pyps_gettime.c.

17 {
18  struct timeval timeend;
19  gettimeofday(&timeend, NULL);
20 
21  long diff = (timeend.tv_sec-timestart->tv_sec)*1000000 + (timeend.tv_usec-timestart->tv_usec);
22 
23  if (__pyps_timefile == 0)
24  __pyps_timefile = fopen(PYPS_TIME_FILE, "w");
25  if (__pyps_timefile)
26  {
27  fprintf(__pyps_timefile, "%s: %ld\n", module, diff);
28  fflush(__pyps_timefile);
29  }
30 }
static char * module
Definition: pips.c:74
static FILE * __pyps_timefile
Definition: pyps_gettime.c:9
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...

References __pyps_timefile, fprintf(), and module.

+ Here is the call graph for this function: