31#if ARCH_X86_X64 && CONFIG2_TIMER_ALLOW_RDTSC
110#define TIMER(description) ScopeTimer UID__(description)
135#define TIMER_BEGIN(description) { ScopeTimer UID__(description)
136#define TIMER_END(description) }
163#if ARCH_X86_X64 && CONFIG2_TIMER_ALLOW_RDTSC
180 m_cycles += t1.m_cycles - t0.m_cycles;
185 m_cycles -= t.m_cycles;
282#define TIMER_ADD_CLIENT(id)\
283 static TimerClient UID__;\
284 static TimerClient* id = timer_AddClient(&UID__, WIDEN(#id))
336#define TIMER_ACCRUE(client) ScopeTimerAccrue UID__(client)
used by TIMER_ACCRUE
Definition: timer.h:295
TimerUnit m_t0
Definition: timer.h:313
NONCOPYABLE(ScopeTimerAccrue)
ScopeTimerAccrue(TimerClient *tc)
Definition: timer.h:298
~ScopeTimerAccrue()
Definition: timer.h:304
TimerClient * m_tc
Definition: timer.h:314
used by TIMER
Definition: timer.h:76
const wchar_t * m_description
Definition: timer.h:93
double m_t0
Definition: timer.h:92
~ScopeTimer()
Definition: timer.h:84
ScopeTimer(const wchar_t *description)
Definition: timer.h:79
double ToSeconds() const
Definition: timer.h:234
void SetToZero()
Definition: timer.h:208
void Subtract(TimerUnit t)
Definition: timer.h:223
std::string ToString() const
Definition: timer.h:228
double m_seconds
Definition: timer.h:240
void AddDifference(TimerUnit t0, TimerUnit t1)
Definition: timer.h:218
void SetFromTimer()
Definition: timer.h:213
void debug_printf(const char *fmt,...)
write a formatted string to the debug channel, subject to filtering (see below).
Definition: debug.cpp:143
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
Definition: debug.h:277
u64 rdtsc()
Definition: x86_x64.cpp:373
double os_cpu_ClockFrequency()
Definition: os_cpu.cpp:43
const wchar_t * description
Definition: timer.h:253
intptr_t num_calls
Definition: timer.h:259
TimerClient * next
Definition: timer.h:255
TimerUnit sum
Definition: timer.h:250
TimerClient * timer_AddClient(TimerClient *tc, const wchar_t *description)
make the given TimerClient (usually instantiated as static data) ready for use.
Definition: timer.cpp:177
std::string StringForCycles(Cycles cycles)
Definition: timer.cpp:225
double timer_Time()
Definition: timer.cpp:130
void timer_Init()
timer_Time will subsequently return values relative to the current time.
Definition: timer.cpp:104
double timer_Resolution()
Definition: timer.cpp:158
std::string StringForSeconds(double seconds)
internal helper functions for returning an easily readable string (i.e.
Definition: timer.cpp:209
i64 Cycles
Definition: timer.h:60
void timer_DisplayClientTotals()
display all clients' totals; does not reset them.
Definition: timer.cpp:192
int64_t i64
Definition: types.h:35
std::string utf8_from_wstring(const std::wstring &src, Status *err)
opposite of wstring_from_utf8
Definition: utf8.cpp:212