21 if (
const char*
p = std::strstr(
buf,
"cpu MHz")) {
22 mhz =
static_cast<U64>(std::strtod(
p + 7,
nullptr));
54 sd::log::engine::profiler::debug(
55 "{}: {} cycles, {:.2f} ms @ 3GHz, {:.2f} ms @ {} MHz (current)",
76 sd::log::engine::profiler::debug(
77 "{}: {} cycles, {:.2f} ms @ 3GHz, {:.2f} ms @ {} MHz (current)",
96#define SD_CONCAT_INNER(a, b) a##b
97#define SD_CONCAT(a, b) SD_CONCAT_INNER(a, b)
99#define PROFILE(name) \
100 ::sd::Profile SD_CONCAT(_sd_profile_, __LINE__) { \
103#define PROFILE_FUNCTION() PROFILE(__func__)
105#define PROFILE_START(name) ::sd::_sd_active_profile.begin(name)
106#define PROFILE_END() ::sd::_sd_active_profile.end()
U64 get_cpu_mhz()
Definition profiler.hpp:15
Definition Application.hpp:22
thread_local Profile _sd_active_profile
Definition profiler.hpp:93
Definition profiler.hpp:35
void begin(const char *new_name)
Definition profiler.hpp:63
Profile(const Profile &)=delete
~Profile() noexcept
Definition profiler.hpp:46
U64 start
Definition profiler.hpp:36
Profile & operator=(Profile &&)=delete
Profile(Profile &&)=delete
const char * name
Definition profiler.hpp:37
Profile & operator=(const Profile &)=delete
U64 end()
Definition profiler.hpp:69
Profile(const char *name)
Definition profiler.hpp:41
consteval U64 type_id_of()
Definition type_id.hpp:6
std::uint32_t U32
Definition types.hpp:15
std::uint64_t U64
Definition types.hpp:16