ATLAS Offline Software
Loading...
Searching...
No Matches
simpletimer.h File Reference

these functions have a precision of about 0.001 ms More...

#include <time.h>
#include <sys/time.h>
Include dependency graph for Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/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)

Detailed Description

these functions have a precision of about 0.001 ms

Author
mark sutton
Date
Thu 22 Jan 2009 15:51:52 GMT

Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration

Definition in file Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/simpletimer.h.

Function Documentation

◆ simpletimer_start()

struct timeval simpletimer_start ( void )
inline

Definition at line 25 of file Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/simpletimer.h.

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

◆ simpletimer_stop()

double simpletimer_stop ( const struct timeval & start_time)
inline

Definition at line 31 of file Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/simpletimer.h.

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