iFun Engine API  1.0.0-b2601
Great Technology for Great Games
 All Classes Files Functions Variables Typedefs Macros
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
fun::WallClock Class Reference

Clock roughly representing wall clock. More...

#include <wall_clock.h>

Inheritance diagram for fun::WallClock:

Public Types

typedef boost::posix_time::ptime Value

Static Public Member Functions

static WallClock::Value FromMonotonicClock (const MonotonicClock::Value &mono_clock)
static Duration FromMsec (int64_t msec)
 Converts msec value into Duration.
static Duration FromSec (int64_t sec)
 Converts sec value into Duration.
static WallClock::Value FromTimestampInMsec (int64_t timestamp_in_msec)
static WallClock::Value FromTimestampInSec (int64_t timestamp_in_second)
static WallClock::Value FromTimestampInUsec (int64_t timestamp_in_usec)
static bool FromTimestring (const string &timestring, WallClock::Value *value)
static Duration FromUsec (int64_t usec)
 Converts usec value into Duration.
static WallClock::Value GetProcessStartTime ()
static WallClock::Duration GetProcessUptime ()
static int64_t GetTimestampInMsec ()
static int64_t GetTimestampInMsec (const WallClock::Value &value)
static int64_t GetTimestampInSec ()
static int64_t GetTimestampInSec (const WallClock::Value &value)
static int64_t GetTimestampInUsec ()
static int64_t GetTimestampInUsec (const WallClock::Value &value)
static string GetTimestring ()
static string GetTimestring (const WallClock::Value &value)
static bool Install (const ArgumentMap &arguments)
static WallClock::Value Now ()
static MonotonicClock::Value ToMonotonicClock (const WallClock::Value &wall_clock)
static bool Uninstall ()
- Static Public Member Functions inherited from fun::Component
static const ArgumentMapFindArgument (const string &component_name)

Static Public Attributes

static const Duration kEmptyDuration
 the value of 00:00:00.000000
static const Value kEpochClock
 The value of time_t(0), 1970-01-01 00:00:00.000000 UTC.

Detailed Description

WallClock is provided for MonotonicClock is not very human-readable. WallClock is synchronized with the system time(wall clock time) during bootstrapping and increases monotonically. Hence, there can be time drift between WallClock and system time. It provides microsecond granularity.

Member Function Documentation

static WallClock::Value fun::WallClock::FromMonotonicClock ( const MonotonicClock::Value mono_clock)
WallClock::Value from the given MonotonicClock::Value.
static MonotonicClock::Value fun::WallClock::ToMonotonicClock ( const WallClock::Value &  wall_clock)
MonotonicClock::Value from the given WallClock::Value.