Sirikata
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes
Sirikata::Timer Class Reference

#include <Timer.hpp>

Collaboration diagram for Sirikata::Timer:

List of all members.

Public Member Functions

 Timer ()
 ~Timer ()
void start ()
Time getTimerStarted () const
Duration elapsed () const

Static Public Member Functions

static void sleep (const Duration &dt)
 Sleep for approximately the given duration.
static void setSystemClockOffset (const Duration &skew)
static Duration getSystemClockOffset ()
static Time getSpecifiedDate (const std::string &datestring)
static Duration getUTCOffset ()
static String nowAsString ()
 Get the current local time as a string, e.g.
static String nowUTCAsString ()
 Get the current time, in UTC, as a string, e.g.
static Time now ()
static Time recentNow ()
 Get the value returned by a recent call to now().
static Duration processElapsed ()
 Get the (approximate) amount of time elapsed since the process started.
static Duration recentProcessElapsed ()
 Get the (approximate) amount of time elapsed since the process started based on a recent check of the timer.

Private Attributes

TimerImplmStart

Static Private Attributes

static Sirikata::AtomicValue
< Duration
sOffset

Constructor & Destructor Documentation

Sirikata::Timer::Timer ( )

References mStart.

Sirikata::Timer::~Timer ( )

References mStart.


Member Function Documentation

Duration Sirikata::Timer::elapsed ( ) const
Time Sirikata::Timer::getSpecifiedDate ( const std::string &  datestring) [static]
Duration Sirikata::Timer::getSystemClockOffset ( ) [static]

References sOffset.

Time Sirikata::Timer::getTimerStarted ( ) const
Duration Sirikata::Timer::getUTCOffset ( ) [static]
Time Sirikata::Timer::now ( ) [static]

References Sirikata::Time::null(), Sirikata::AtomicValue< T >::read(), and sOffset.

Referenced by Sirikata::OH::SQLiteStorage::acquireLease(), Sirikata::OH::CassandraStorage::acquireLease(), Sirikata::AggregateManager::addChild(), Sirikata::DistributedCoordinateSegmentation::asyncLLRead(), Sirikata::Input::InputDevice::changeButton(), Sirikata::Network::IOStrand::dispatch(), Sirikata::TimeProfiler::Stage::finished(), Sirikata::Input::InputDevice::fireButton(), Sirikata::AggregateManager::generateAggregateMesh(), Sirikata::AggregateManager::generateAggregateMeshAsync(), Sirikata::AggregateManager::generateMeshesFromQueue(), Sirikata::CoordinateSegmentationClient::getLeasedSocket(), Sirikata::AggregateManager::handleUploadFinished(), Sirikata::AggregateManager::iRemoveChild(), main(), Sirikata::SST::Connection< EndPointType >::markAcknowledgedPacket(), Sirikata::AggregateManager::metadataFinished(), Sirikata::Network::IOStrand::post(), Sirikata::Network::IOService::post(), processElapsed(), Sirikata::OH::SQLiteStorage::processRenewals(), Sirikata::OH::CassandraStorage::processRenewals(), Sirikata::SST::Stream< EndPointType >::receiveData(), Sirikata::OH::SQLiteStorage::renewLease(), Sirikata::OH::CassandraStorage::renewLease(), Sirikata::CoordinateSegmentationClient::service(), Sirikata::SST::Connection< EndPointType >::serviceConnection(), Sirikata::SST::Stream< EndPointType >::serviceStream(), Sirikata::Context::simTime(), Sirikata::TimeProfiler::Stage::started(), and Sirikata::AggregateManager::uploadAggregateMesh().

String Sirikata::Timer::nowAsString ( ) [static]

Get the current local time as a string, e.g.

2002-Jan-01 10:00:01.123456789. Useful for reporting the real date when something happened.

Referenced by Sirikata::ReportVersion().

String Sirikata::Timer::nowUTCAsString ( ) [static]

Get the current time, in UTC, as a string, e.g.

2002-Jan-01 10:00:01.123456789. Useful for reporting the real date when something happened.

Duration Sirikata::Timer::processElapsed ( ) [static]

Get the (approximate) amount of time elapsed since the process started.

References now(), and Sirikata::AtomicValue< T >::read().

Time Sirikata::Timer::recentNow ( ) [static]

Get the value returned by a recent call to now().

Avoids the overhead of actually checking the time if you know something else is checking it frequently enough

References Sirikata::AtomicValue< T >::read().

Duration Sirikata::Timer::recentProcessElapsed ( ) [static]

Get the (approximate) amount of time elapsed since the process started based on a recent check of the timer.

This can be out of date, but is fairly accurate if you regularly check the time and much faster than processElapsed().

References Sirikata::AtomicValue< T >::read().

void Sirikata::Timer::setSystemClockOffset ( const Duration skew) [static]

References sOffset.

Referenced by Sirikata::TimeSync_sync_thread().

void Sirikata::Timer::sleep ( const Duration dt) [static]
void Sirikata::Timer::start ( )

Member Data Documentation


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