#include "precompiled.h"
#include "lib/timer.h"
#include <sstream>
#include <numeric>
#include <cmath>
#include <cfloat>
#include <cstdarg>
#include "lib/module_init.h"
#include "lib/posix/posix_pthread.h"
#include "lib/posix/posix_time.h"
#include "lib/sysdep/cpu.h"
Go to the source code of this file.
#define HAVE_CLOCK_GETTIME 0 |
#define HAVE_GETTIMEOFDAY 0 |
static void EnsureMonotonic |
( |
double & |
newTime | ) |
|
|
static |
static Status InitResolution |
( |
| ) |
|
|
static |
std::wstring StringForCycles |
( |
Cycles |
cycles | ) |
|
std::wstring StringForSeconds |
( |
double |
seconds | ) |
|
internal helper functions for returning an easily readable string (i.e.
re-scaled to appropriate units)
Definition at line 204 of file timer.cpp.
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:
- may be called at any time;
- always succeeds (there's no fixed limit);
- free() is not needed nor possible.
- description must remain valid until exit; a string literal is safest.
Definition at line 166 of file timer.cpp.
void timer_DisplayClientTotals |
( |
| ) |
|
display all clients' totals; does not reset them.
typically called at exit.
Definition at line 181 of file timer.cpp.
void timer_LatchStartTime |
( |
| ) |
|
timer_Time will subsequently return values relative to the current time.
Definition at line 74 of file timer.cpp.
double timer_Resolution |
( |
| ) |
|
- Returns
- resolution [s] of the timer.
Definition at line 145 of file timer.cpp.
- Returns
- high resolution (> 1 us) timestamp [s].
Definition at line 98 of file timer.cpp.