proxygen
proxygen::TimeUtilGeneric< ClockType > Class Template Reference

#include <Time.h>

Inheritance diagram for proxygen::TimeUtilGeneric< ClockType >:
proxygen::MockTimeUtilGeneric< ClockType >

Public Member Functions

virtual ~TimeUtilGeneric ()
 
virtual std::chrono::time_point< ClockType > now () const
 
virtual uint64_t msSinceEpoch ()
 

Static Public Member Functions

static const std::chrono::time_point< ClockType > & getZeroTimePoint ()
 

Detailed Description

template<typename ClockType = SteadyClock>
class proxygen::TimeUtilGeneric< ClockType >

Class used to get steady time. We use a separate class to mock it easier.

Definition at line 170 of file Time.h.

Constructor & Destructor Documentation

template<typename ClockType = SteadyClock>
virtual proxygen::TimeUtilGeneric< ClockType >::~TimeUtilGeneric ( )
inlinevirtual

Definition at line 172 of file Time.h.

172 {}

Member Function Documentation

template<typename ClockType = SteadyClock>
static const std::chrono::time_point<ClockType>& proxygen::TimeUtilGeneric< ClockType >::getZeroTimePoint ( )
inlinestatic

Definition at line 178 of file Time.h.

Referenced by proxygen::compress::SimStreamingCallback::onHeadersComplete().

178  {
179  const static std::chrono::time_point<ClockType> kZeroTimePoint{};
180  return kZeroTimePoint;
181  }
template<typename ClockType = SteadyClock>
virtual uint64_t proxygen::TimeUtilGeneric< ClockType >::msSinceEpoch ( )
inlinevirtual

Please use strongly typed time_point. This is for avoiding the copy and garbage collection of time_point in Lua.

Definition at line 187 of file Time.h.

References proxygen::millisecondsSinceEpoch().

187  {
188  return millisecondsSinceEpoch().count();
189  }
std::chrono::milliseconds millisecondsSinceEpoch()
Definition: Time.h:56
template<typename ClockType = SteadyClock>
virtual std::chrono::time_point<ClockType> proxygen::TimeUtilGeneric< ClockType >::now ( ) const
inlinevirtual

Reimplemented in proxygen::MockTimeUtilGeneric< ClockType >.

Definition at line 174 of file Time.h.

Referenced by proxygen::TraceEvent::end(), and proxygen::TraceEvent::start().

174  {
175  return getCurrentTime<ClockType>();
176  }

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