20#include <sys/sys_time.h>
21#include <sys/time_util.h>
25#if defined(SUNOS) || defined(__SUNOS__)
29#include <mach/mach_time.h>
30#include <TargetConditionals.h>
33#if defined(WIN32) || defined(_WIN32)
35#define BT_USE_WINDOWS_TIMERS
36#define WIN32_LEAN_AND_MEAN
47#define GetTickCount64 GetTickCount
57#ifdef BT_LINUX_REALTIME
64#define mymin(a, b) (a > b ? a : b)
68#ifdef BT_USE_WINDOWS_TIMERS
88#ifdef BT_USE_WINDOWS_TIMERS
114#ifdef BT_USE_WINDOWS_TIMERS
138#ifdef BT_USE_WINDOWS_TIMERS
173#ifdef BT_USE_WINDOWS_TIMERS
207#ifdef BT_USE_WINDOWS_TIMERS
249#ifdef BT_LINUX_REALTIME
252 return 1000000000 *
ts.tv_sec +
ts.tv_nsec;
316void CProfileNode::CleanupMemory()
324CProfileNode::~CProfileNode(
void)
353 node->Sibling =
Child;
358void CProfileNode::Reset(
void)
373void CProfileNode::Call(
void)
382bool CProfileNode::Return(
void)
386 unsigned long int time;
406void CProfileIterator::First(
void)
411void CProfileIterator::Next(
void)
416bool CProfileIterator::Is_Done(
void)
421void CProfileIterator::Enter_Child(
int index)
437void CProfileIterator::Enter_Parent(
void)
538int CProfileManager::FrameCounter = 0;
539unsigned long int CProfileManager::ResetTime = 0;
550void CProfileManager::CleanupMemory(
void)
554 gRoots[i].CleanupMemory();
571void CProfileManager::Start_Profile(
const char*
name)
588void CProfileManager::Stop_Profile(
void)
607void CProfileManager::Reset(
void)
622void CProfileManager::Increment_Frame_Counter(
void)
630float CProfileManager::Get_Time_Since_Reset(
void)
632 unsigned long int time;
650 printf(
"----------------------------------\n");
687void CProfileManager::dumpAll()
716#if defined(_WIN32) && (defined(__MINGW32__) || defined(__MINGW64__))
717 #define BT_HAVE_TLS 1
718#elif __APPLE__ && !TARGET_OS_IPHONE
720 #define BT_HAVE_TLS 1
722 #define BT_HAVE_TLS 1
723#elif defined(__FreeBSD__) || defined(__NetBSD__)
725 #define BT_HAVE_TLS 1
730#if defined(__ANDROID__) && defined(__clang__)
731 #if __has_include(<android/ndk-version.h>)
732 #include <android/ndk-version.h>
734 #if defined(__NDK_MAJOR__) && \
735 ((__NDK_MAJOR__ < 12) || ((__NDK_MAJOR__ == 12) && (__NDK_MINOR__ < 1)))
748#if defined(BT_HAVE_TLS)
unsigned long long int uint64_t
const T & btMax(const T &a, const T &b)
btEnterProfileZoneFunc * btGetCurrentEnterProfileZoneFunc()
void btSetCustomEnterProfileZoneFunc(btEnterProfileZoneFunc *enterFunc)
static btEnterProfileZoneFunc * bts_enterFunc
void btLeaveProfileZone()
void btLeaveProfileZoneDefault()
void btSetCustomLeaveProfileZoneFunc(btLeaveProfileZoneFunc *leaveFunc)
void btEnterProfileZoneDefault(const char *name)
void btEnterProfileZone(const char *name)
unsigned int btQuickprofGetCurrentThreadIndex2()
static btLeaveProfileZoneFunc * bts_leaveFunc
btLeaveProfileZoneFunc * btGetCurrentLeaveProfileZoneFunc()
void() btLeaveProfileZoneFunc()
const unsigned int BT_QUICKPROF_MAX_THREAD_COUNT
void() btEnterProfileZoneFunc(const char *msg)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
unsigned int btGetCurrentThreadIndex()
static ThreadsafeCounter gThreadCounter
CProfileSample(const char *name)
The btClock is a portable basic clock that measures accurate time in seconds, use for profiling.
btScalar getTimeSeconds()
Returns the time in s since the last call to reset or since the Clock was created.
unsigned long long int getTimeNanoseconds()
void reset()
Resets the initial reference time.
struct btClockData * m_data
unsigned long long int getTimeMilliseconds()
Returns the time in ms since the last call to reset or since the btClock was created.
unsigned long long int getTimeMicroseconds()
Returns the time in us since the last call to reset or since the Clock was created.
btClock()
The btClock is a portable basic clock that measures accurate time in seconds, use for profiling.
btClock & operator=(const btClock &other)
LARGE_INTEGER mClockFrequency