ATLAS Offline Software
Loading...
Searching...
No Matches
simpletimer.h File Reference
#include <time.h>
#include <sys/time.h>
Include dependency graph for DataQuality/HanConfigGenerator/src/simpletimer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

struct timeval simpletimer_start (void)
double simpletimer_stop (const struct timeval &start_time)

Function Documentation

◆ simpletimer_start()

struct timeval simpletimer_start ( void )
inline

Definition at line 26 of file DataQuality/HanConfigGenerator/src/simpletimer.h.

26 {
27 struct timeval start_time;
28 gettimeofday(&start_time, NULL);
29 return start_time;
30}

◆ simpletimer_stop()

double simpletimer_stop ( const struct timeval & start_time)
inline

Definition at line 32 of file DataQuality/HanConfigGenerator/src/simpletimer.h.

33{
34 struct timeval stop_time;
35 struct timeval diff_time;
36 gettimeofday(&stop_time, NULL);
37 diff_time.tv_sec = stop_time.tv_sec - start_time.tv_sec;
38 diff_time.tv_usec = stop_time.tv_usec - start_time.tv_usec;
39 return (diff_time.tv_sec*1000.0) + (diff_time.tv_usec/1000.0);
40}