2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-11 13:07:42 +00:00

Runtime: Wrap fmt::print calls in #ifndef NDEBUG

This commit is contained in:
2020-04-11 02:25:41 -04:00
parent 11d948943d
commit e23c3d3705
3 changed files with 8 additions and 2 deletions

View File

@@ -12,13 +12,17 @@ public:
double report(const char* name) const {
double t = std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::steady_clock::now() - m_start).count() / 1000000.0;
#ifndef NDEBUG
fmt::print(fmt("{} {}\n"), name, t);
#endif
return t;
}
double reportReset(const char* name) {
std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
double t = std::chrono::duration_cast<std::chrono::microseconds>(now - m_start).count() / 1000000.0;
#ifndef NDEBUG
fmt::print(fmt("{} {}\n"), name, t);
#endif
m_start = now;
return t;
}