OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Timer< TimeT > Class Template Reference

#include <measure.h>

Public Member Functions

 Timer ()
 
void start ()
 
void stop ()
 
TimeT::rep elapsed ()
 

Private Attributes

std::chrono::steady_clock::time_point start_time_
 
TimeT::rep duration
 
bool timer_started_
 

Detailed Description

template<typename TimeT = std::chrono::milliseconds>
class Timer< TimeT >

Definition at line 55 of file measure.h.

Constructor & Destructor Documentation

template<typename TimeT = std::chrono::milliseconds>
Timer< TimeT >::Timer ( )
inline

Definition at line 57 of file measure.h.

57 : duration{0}, timer_started_(false) {}
TimeT::rep duration
Definition: measure.h:76
bool timer_started_
Definition: measure.h:77

Member Function Documentation

template<typename TimeT = std::chrono::milliseconds>
TimeT::rep Timer< TimeT >::elapsed ( )
inline

Definition at line 72 of file measure.h.

References Timer< TimeT >::duration.

Referenced by foreign_storage::LazyParquetChunkLoader::appendRowGroups(), and foreign_storage::LazyParquetChunkLoader::metadataScan().

72 { return duration; }
TimeT::rep duration
Definition: measure.h:76

+ Here is the caller graph for this function:

template<typename TimeT = std::chrono::milliseconds>
void Timer< TimeT >::start ( )
inline

Definition at line 59 of file measure.h.

References Timer< TimeT >::start_time_, timer_start(), and Timer< TimeT >::timer_started_.

Referenced by foreign_storage::LazyParquetChunkLoader::appendRowGroups(), and foreign_storage::LazyParquetChunkLoader::metadataScan().

59  {
61  timer_started_ = true;
62  }
std::chrono::steady_clock::time_point start_time_
Definition: measure.h:75
Type timer_start()
Definition: measure.h:42
bool timer_started_
Definition: measure.h:77

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename TimeT = std::chrono::milliseconds>
void Timer< TimeT >::stop ( )
inline

Definition at line 64 of file measure.h.

References Timer< TimeT >::duration, LOG, Timer< TimeT >::start_time_, Timer< TimeT >::timer_started_, timer_stop(), and logger::WARNING.

Referenced by foreign_storage::LazyParquetChunkLoader::appendRowGroups(), and foreign_storage::LazyParquetChunkLoader::metadataScan().

64  {
65  if (!timer_started_) {
66  LOG(WARNING) << " unexpected call to stop on a timer that has not started";
67  }
69  timer_started_ = false;
70  }
#define LOG(tag)
Definition: Logger.h:285
TypeR::rep timer_stop(Type clock_begin)
Definition: measure.h:48
TimeT::rep duration
Definition: measure.h:76
std::chrono::steady_clock::time_point start_time_
Definition: measure.h:75
bool timer_started_
Definition: measure.h:77

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

template<typename TimeT = std::chrono::milliseconds>
TimeT::rep Timer< TimeT >::duration
private

Definition at line 76 of file measure.h.

Referenced by Timer< TimeT >::elapsed(), and Timer< TimeT >::stop().

template<typename TimeT = std::chrono::milliseconds>
std::chrono::steady_clock::time_point Timer< TimeT >::start_time_
private

Definition at line 75 of file measure.h.

Referenced by Timer< TimeT >::start(), and Timer< TimeT >::stop().

template<typename TimeT = std::chrono::milliseconds>
bool Timer< TimeT >::timer_started_
private

Definition at line 77 of file measure.h.

Referenced by Timer< TimeT >::start(), and Timer< TimeT >::stop().


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