2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-10 02:27:42 +00:00

Add -l flag to enable logging

This commit is contained in:
Jack Andersen
2017-11-18 21:10:54 -10:00
parent 172a0049cc
commit 3522d757fc
8 changed files with 46 additions and 6 deletions

21
Runtime/CStopwatch.hpp Normal file
View File

@@ -0,0 +1,21 @@
#ifndef __URDE_CSTOPWATCH_HPP__
#define __URDE_CSTOPWATCH_HPP__
#include <chrono>
namespace urde
{
class CStopwatch
{
std::chrono::steady_clock::time_point m_start;
public:
CStopwatch() : m_start(std::chrono::steady_clock::now()) {}
void report(const char* name) const
{
printf("%s %f\n", name, std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::steady_clock::now() - m_start).count() / 1000000.f);
}
};
}
#endif // __URDE_CSTOPWATCH_HPP__