Static Public Member Functions

kNet::Clock Class Reference

High-resolution timing and system time. More...

#include <Clock.h>

List of all members.

Static Public Member Functions

static void Sleep (int milliseconds)
 Sleeps the current thread for the given amount of milliseconds.
static int Year ()
static int Month ()
static int Day ()
static int Hour ()
static int Min ()
static int Sec ()
static unsigned long SystemTime ()
static unsigned long Time ()
static unsigned long TickU32 ()
static tick_t Tick ()
static tick_t TicksPerSec ()
static tick_t TicksInBetween (tick_t newTick, tick_t oldTick)
 Returns the number of ticks occurring between the two wallclock times.
static bool IsNewer (tick_t newTick, tick_t oldTick)
 Returns true if newTick represents a later wallclock time than oldTick.

Detailed Description

High-resolution timing and system time.

Gives out timing information in various forms. Use this rather than any platform-dependent perf-counters or rdtsc or whatever.


Member Function Documentation

int kNet::Clock::Year (  )  [static]
Returns:
The current year.

Todo:
.

int kNet::Clock::Month (  )  [static]
Returns:
The current month, [1,12]

Todo:
.

int kNet::Clock::Day (  )  [static]
Returns:
The current day of month, [1,31]

Todo:
.

int kNet::Clock::Hour (  )  [static]
Returns:
The current hour of day, [0,23]

Todo:
.

int kNet::Clock::Min (  )  [static]
Returns:
The current clock minute, [0,59]

Todo:
.

int kNet::Clock::Sec (  )  [static]
Returns:
The current clock second, [0,59]

Todo:
.

unsigned long kNet::Clock::SystemTime (  )  [static]
Returns:
The current system time counter in milliseconds.

References TickU32().

unsigned long kNet::Clock::Time (  )  [static]
Returns:
The number of milliseconds since application start.

References Tick().

unsigned long kNet::Clock::TickU32 (  )  [static]
Returns:
The low part of the current tick-time (using whatever high-resolution counter available)

References Tick().

Referenced by SystemTime().

tick_t kNet::Clock::Tick (  )  [static]
tick_t kNet::Clock::TicksPerSec (  )  [static]
Returns:
How many ticks make up a second.

Referenced by kNet::MessageConnection::ComputeStats().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines