Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
#include "precompiled.h"
#include "lib/timer.h"
#include <cfloat>
#include <cmath>
#include <cstdarg>
#include <mutex>
#include <numeric>
#include <sstream>
#include "lib/module_init.h"
#include "lib/posix/posix_time.h"
#include "lib/sysdep/cpu.h"
Macros | |
#define | HAVE_GETTIMEOFDAY 0 |
#define | HAVE_CLOCK_GETTIME 0 |
Functions | |
static Status | InitResolution () |
void | timer_Init () |
timer_Time will subsequently return values relative to the current time. More... | |
static void | EnsureMonotonic (double &newTime) |
double | timer_Time () |
double | timer_Resolution () |
TimerClient * | timer_AddClient (TimerClient *tc, const wchar_t *description) |
make the given TimerClient (usually instantiated as static data) ready for use. More... | |
void | timer_DisplayClientTotals () |
display all clients' totals; does not reset them. More... | |
std::string | StringForSeconds (double seconds) |
internal helper functions for returning an easily readable string (i.e. More... | |
std::string | StringForCycles (Cycles cycles) |
Variables | |
static double | resolution |
static std::mutex | ensure_monotonic_mutex |
static size_t | numClients |
static TimerClient * | clients |
#define HAVE_CLOCK_GETTIME 0 |
#define HAVE_GETTIMEOFDAY 0 |
|
static |
|
static |
std::string StringForCycles | ( | Cycles | cycles | ) |
std::string StringForSeconds | ( | double | seconds | ) |
internal helper functions for returning an easily readable string (i.e.
re-scaled to appropriate units)
TimerClient * timer_AddClient | ( | TimerClient * | tc, |
const wchar_t * | description | ||
) |
make the given TimerClient (usually instantiated as static data) ready for use.
returns its address for TIMER_ADD_CLIENT's convenience. this client's total (which is increased by a BillingPolicy) will be displayed by timer_DisplayClientTotals. notes:
void timer_DisplayClientTotals | ( | ) |
display all clients' totals; does not reset them.
typically called at exit.
void timer_Init | ( | ) |
timer_Time will subsequently return values relative to the current time.
double timer_Resolution | ( | ) |
double timer_Time | ( | ) |
|
static |
|
static |
|
static |
|
static |