Agora  1.2.0
Agora project
timer.h File Reference
#include <algorithm>
#include <cmath>
#include <numeric>
#include <vector>
Include dependency graph for timer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TscTimer
 Simple time that uses RDTSC. More...
 

Functions

static size_t rdtsc ()
 Return the TSC. More...
 
static void nano_sleep (size_t ns, double freq_ghz)
 
static double measure_rdtsc_freq ()
 
static double to_sec (size_t cycles, double freq_ghz)
 Convert cycles measured by rdtsc with frequence freq_ghz to seconds. More...
 
static double to_msec (size_t cycles, double freq_ghz)
 Convert cycles measured by rdtsc with frequence freq_ghz to msec. More...
 
static double to_usec (size_t cycles, double freq_ghz)
 Convert cycles measured by rdtsc with frequence freq_ghz to usec. More...
 
static size_t us_to_cycles (double us, double freq_ghz)
 
static size_t ns_to_cycles (double ns, double freq_ghz)
 
static double to_nsec (size_t cycles, double freq_ghz)
 Convert cycles measured by rdtsc with frequence freq_ghz to nsec. More...
 
static double sec_since (const struct timespec &t0)
 Return seconds elapsed since timestamp t0. More...
 
static double ns_since (const struct timespec &t0)
 Return nanoseconds elapsed since timestamp t0. More...
 
static double stddev (const std::vector< double > in_vec)
 
static double mean (const std::vector< double > in_vec)
 

Variables

static const auto & dpath_rdtsc = rdtsc
 An alias for rdtsc() to distinguish calls on the critical path. More...
 

Function Documentation

◆ mean()

static double mean ( const std::vector< double >  in_vec)
static
Here is the caller graph for this function:

◆ measure_rdtsc_freq()

static double measure_rdtsc_freq ( )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ nano_sleep()

static void nano_sleep ( size_t  ns,
double  freq_ghz 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ns_since()

static double ns_since ( const struct timespec &  t0)
static

Return nanoseconds elapsed since timestamp t0.

◆ ns_to_cycles()

static size_t ns_to_cycles ( double  ns,
double  freq_ghz 
)
static

◆ rdtsc()

static size_t rdtsc ( )
inlinestatic

Return the TSC.

Here is the caller graph for this function:

◆ sec_since()

static double sec_since ( const struct timespec &  t0)
static

Return seconds elapsed since timestamp t0.

◆ stddev()

static double stddev ( const std::vector< double >  in_vec)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_msec()

static double to_msec ( size_t  cycles,
double  freq_ghz 
)
static

Convert cycles measured by rdtsc with frequence freq_ghz to msec.

Here is the caller graph for this function:

◆ to_nsec()

static double to_nsec ( size_t  cycles,
double  freq_ghz 
)
static

Convert cycles measured by rdtsc with frequence freq_ghz to nsec.

Here is the caller graph for this function:

◆ to_sec()

static double to_sec ( size_t  cycles,
double  freq_ghz 
)
static

Convert cycles measured by rdtsc with frequence freq_ghz to seconds.

◆ to_usec()

static double to_usec ( size_t  cycles,
double  freq_ghz 
)
static

Convert cycles measured by rdtsc with frequence freq_ghz to usec.

◆ us_to_cycles()

static size_t us_to_cycles ( double  us,
double  freq_ghz 
)
static

Variable Documentation

◆ dpath_rdtsc

const auto& dpath_rdtsc = rdtsc
static

An alias for rdtsc() to distinguish calls on the critical path.