A lightweight, header-only C++ timer for measuring code execution time using RAII.
{
Timer<Timer_Aliases::ms> timer("Some Operation");
// your code here
} // automatically prints: [Some Operation] Took: 42ms
{
ManualTimer<Timer_Aliases::ms> manualTimer ("Manual Timer");
while(true)
{
manualTimer.StartTimer();
// your code here
manualTimer.StopTimer();
} // automatically prints: [Manual Timer] Took: 42ms
{
void CustomLog(const char* name, int64_t amount,const char* type)
{
// your code here
}
void foo()
{
Timer<Timer_Aliases::ms> timer("Some Operation",CustomLog);
// your code here
}
}