DASH  0.3.0
dash::util::Timer< TimeMeasure::Counter > Class Template Reference

Public Types

typedef Timestamp::counter_t timestamp_t
 
typedef Timestamp_t timestamp_type
 
typedef timestamp_t timestamp
 

Public Member Functions

 Timer (const self_t &other)=default
 
Timeroperator= (const self_t &other)
 
double Elapsed () const
 Microseconds elapsed since instantiation of this Timer object. More...
 
const timestamp_t & Start () const
 Returns timestamp from instantiation of this Timer. More...
 

Static Public Member Functions

static double ElapsedSince (timestamp_t timestamp)
 Microseconds elapsed since given timestamp. More...
 
static timestamp_t Now ()
 Produces current timestamp. More...
 
static double FromInterval (const timestamp_t &start, const timestamp_t &end)
 Convert interval of two timestamp values to mircoseconds. More...
 
static double FromInterval (const double &start, const double &end)
 Convert interval of two timestamp values to mircoseconds. More...
 
static void Calibrate (unsigned int freq=0)
 
static const char * TimerName ()
 
static Timestamp::counter_t TimestampInfinity ()
 
static Timestamp::counter_t TimestampNegInfinity ()
 
static double FrequencyScaling ()
 

Detailed Description

template<>
class dash::util::Timer< TimeMeasure::Counter >

Definition at line 172 of file Timer.h.

Member Function Documentation

◆ Elapsed()

double dash::util::Timer< TimeMeasure::Counter >::Elapsed ( ) const
inline

Microseconds elapsed since instantiation of this Timer object.

Definition at line 218 of file Timer.h.

219  {
220  timestamp_t now;
221  Timestamp_t timestamp;
222  now = timestamp.Value();
223  return (static_cast<double>(now - timestampStart) *
224  static_cast<double>(Timestamp_t::FrequencyPrescale())) /
225  static_cast<double>(Timestamp_t::FrequencyScaling());
226  }

◆ ElapsedSince()

static double dash::util::Timer< TimeMeasure::Counter >::ElapsedSince ( timestamp_t  timestamp)
inlinestatic

Microseconds elapsed since given timestamp.

Definition at line 239 of file Timer.h.

240  {
241  Timestamp_t now;
242  return (static_cast<double>(now.Value() - timestamp) *
243  static_cast<double>(Timestamp_t::FrequencyPrescale())) /
244  static_cast<double>(Timestamp_t::FrequencyScaling());
245  }

◆ FromInterval() [1/2]

static double dash::util::Timer< TimeMeasure::Counter >::FromInterval ( const timestamp_t &  start,
const timestamp_t &  end 
)
inlinestatic

Convert interval of two timestamp values to mircoseconds.

Definition at line 259 of file Timer.h.

262  {
263  return (static_cast<double>(end - start) *
264  static_cast<double>(Timestamp_t::FrequencyPrescale())) /
265  static_cast<double>(Timestamp_t::FrequencyScaling());
266  }
constexpr auto end(RangeType &&range) -> decltype(std::forward< RangeType >(range).end())
Definition: Range.h:98

◆ FromInterval() [2/2]

static double dash::util::Timer< TimeMeasure::Counter >::FromInterval ( const double &  start,
const double &  end 
)
inlinestatic

Convert interval of two timestamp values to mircoseconds.

Definition at line 271 of file Timer.h.

274  {
275  return ((end - start) *
276  Timestamp_t::FrequencyPrescale() /
277  Timestamp_t::FrequencyScaling());
278  }
constexpr auto end(RangeType &&range) -> decltype(std::forward< RangeType >(range).end())
Definition: Range.h:98

◆ Now()

static timestamp_t dash::util::Timer< TimeMeasure::Counter >::Now ( )
inlinestatic

Produces current timestamp.

Definition at line 250 of file Timer.h.

251  {
252  Timestamp_t timestamp;
253  return timestamp.Value();
254  }

◆ Start()

const timestamp_t& dash::util::Timer< TimeMeasure::Counter >::Start ( ) const
inline

Returns timestamp from instantiation of this Timer.

Definition at line 231 of file Timer.h.

232  {
233  return timestampStart;
234  }

The documentation for this class was generated from the following file: