69 return entry == childID;
78 if (g_profileTimersState[child])
80 ret += g_profileTimers[child].get();
93 if (g_profileTimersState[child])
95 ret.append(
"\n " + g_profileTimers[child].
print(level + 1));
99 for (
U32 i = 0u; i < level; ++i)
109 constexpr U8 overheadLoopCount = 3u;
114 for (
U8 i = 0u; i < overheadLoopCount; ++i)
121 return overhead / overheadLoopCount;
130 if (!g_profileTimersState[
entry._globalIndex] ||
132 entry._timerCounter == 0u)
137 ret.append(
entry.print());
149 g_profileTimersState.fill(
false);
154 entry._globalIndex = index++;
161 if (!g_profileTimersState[
entry._globalIndex])
164 entry._name = timerName;
165 g_profileTimersState[
entry._globalIndex] =
true;
171 return g_profileTimers[0];
179 g_profileTimers[timer.
_parent].removeChildTimer(timer);
void removeChildTimer(ProfileTimer &child)
void addChildTimer(ProfileTimer &child)
static void removeTimer(ProfileTimer &timer)
static ProfileTimer & getNewTimer(const char *timerName)
U64 getChildTotal() const
string print(U32 level=0) const
bool hasChildTimer(const ProfileTimer &child) const
ScopedTimer(ProfileTimer &timer) noexcept
constexpr unsigned short MAX_PROFILE_TIMERS
How many profiling timers are we allowed to use in our applications. We allocate them upfront,...
U64 ElapsedMicroseconds() noexcept
std::array< ProfileTimer, Config::Profile::MAX_PROFILE_TIMERS > g_profileTimers
std::array< bool, Config::Profile::MAX_PROFILE_TIMERS > g_profileTimersState
Str StringFormat(const char *fmt, Args &&...args)
Project const SceneEntry & entry