libjmmcg  build_2783
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::hp_timer< ppd::generic_traits::api_type::posix_pthreads, Mdl > Class Template Reference

#include <hp_timer.hpp>

Public Types

typedef ppd::api_lock_traits< ppd::generic_traits::api_type::posix_pthreads, Mdl > lock_traits
 
typedef lock_traits::exception_type exception_type
 
typedef unsigned long long value_type
 The units are microseconds. More...
 
typedef timespec time_utc_t
 

Public Member Functions

__stdcall hp_timer () noexcept(false) FORCE_INLINE
 
const time_utc_t __fastcall current_time () const noexcept(false) FORCE_INLINE
 Return the current time in a resolution of 1/frequency units. More...
 

Static Public Member Functions

static value_type __fastcall to_usec (const time_utc_t ticks) noexcept(true) FORCE_INLINE
 Convert a value_type in units of 1/frequency to usec. More...
 
static value_type __fastcall current_count () noexcept(false) FORCE_INLINE
 The current count in units of 1/frequency. More...
 

Public Attributes

const time_utc_t start_up_time
 
const value_type start_up_count
 In usec. More...
 

Friends

std::ostream &__fastcall operator<< (std::ostream &o, const time_utc_t &t)
 

Detailed Description

template<typename Mdl>
class jmmcg::hp_timer< ppd::generic_traits::api_type::posix_pthreads, Mdl >

Definition at line 50 of file hp_timer.hpp.

Member Typedef Documentation

◆ exception_type

template<typename Mdl >
typedef lock_traits::exception_type jmmcg::hp_timer< ppd::generic_traits::api_type::posix_pthreads, Mdl >::exception_type

Definition at line 70 of file hp_timer.hpp.

◆ lock_traits

◆ time_utc_t

template<typename Mdl >
typedef timespec jmmcg::hp_timer< ppd::generic_traits::api_type::posix_pthreads, Mdl >::time_utc_t

Definition at line 73 of file hp_timer.hpp.

◆ value_type

template<typename Mdl >
typedef unsigned long long jmmcg::hp_timer< ppd::generic_traits::api_type::posix_pthreads, Mdl >::value_type

The units are microseconds.

Definition at line 72 of file hp_timer.hpp.

Constructor & Destructor Documentation

◆ hp_timer()

template<typename Mdl >
jmmcg::hp_timer< ppd::generic_traits::api_type::posix_pthreads, Mdl >::hp_timer ( )
inlinenoexcept

Definition at line 70 of file hp_timer_impl.hpp.

Member Function Documentation

◆ current_count()

template<typename Mdl >
hp_timer< ppd::generic_traits::api_type::posix_pthreads, Mdl >::value_type jmmcg::hp_timer< ppd::generic_traits::api_type::posix_pthreads, Mdl >::current_count ( )
inlinestaticnoexcept

The current count in units of 1/frequency.

Definition at line 58 of file hp_timer_impl.hpp.

◆ current_time()

template<typename Mdl >
const hp_timer< ppd::generic_traits::api_type::posix_pthreads, Mdl >::time_utc_t jmmcg::hp_timer< ppd::generic_traits::api_type::posix_pthreads, Mdl >::current_time ( ) const
inlinenoexcept

Return the current time in a resolution of 1/frequency units.

Note that this will have a systematic offset according to the properties of GetSystemTimeAsFileTime().

Returns
Time (NOT local time!) in UTC.

Definition at line 64 of file hp_timer_impl.hpp.

◆ to_usec()

template<typename Mdl >
hp_timer< ppd::generic_traits::api_type::posix_pthreads, Mdl >::value_type jmmcg::hp_timer< ppd::generic_traits::api_type::posix_pthreads, Mdl >::to_usec ( const time_utc_t  ticks)
inlinestaticnoexcept

Convert a value_type in units of 1/frequency to usec.

Definition at line 41 of file hp_timer_impl.hpp.

Friends And Related Function Documentation

◆ operator<<

template<typename Mdl >
std::ostream& __fastcall operator<< ( std::ostream &  o,
const time_utc_t t 
)
friend

Implemented using the advice given in "Standard C++ IOStreams and Locales" by A.Langer & K.Kreft, page 170.

Member Data Documentation

◆ start_up_count

template<typename Mdl >
const value_type jmmcg::hp_timer< ppd::generic_traits::api_type::posix_pthreads, Mdl >::start_up_count

In usec.

Count in usec when the process started up.

Definition at line 83 of file hp_timer.hpp.

◆ start_up_time

template<typename Mdl >
const time_utc_t jmmcg::hp_timer< ppd::generic_traits::api_type::posix_pthreads, Mdl >::start_up_time

Time when the process started up.

Definition at line 78 of file hp_timer.hpp.


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