add debug timer macro.
This commit is contained in:
Binary file not shown.
@@ -1,10 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <time.h>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <mutex>
|
||||
|
||||
#include "Common.h"
|
||||
#include "IUnityInterface.h"
|
||||
|
||||
|
||||
// Debug flag
|
||||
#define UDD_DEBUG_ON
|
||||
|
||||
|
||||
// Logging
|
||||
class Debug
|
||||
{
|
||||
@@ -133,4 +141,15 @@ private:
|
||||
static DebugLogFuncPtr logFunc_;
|
||||
static DebugLogFuncPtr errFunc_;
|
||||
static std::mutex mutex_;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#ifdef UDD_DEBUG_ON
|
||||
#define UDD_FUNCTION_SCOPE_TIMER \
|
||||
ScopedTimer _timer_##__COUNTER__([](std::chrono::microseconds us) \
|
||||
{ \
|
||||
Debug::Log(__FUNCTION__, "@", __FILE__, ":", __LINE__, " => ", us.count(), " (us)"); \
|
||||
});
|
||||
#else
|
||||
#define UDD_FUNCTION_SCOPE_TIMER
|
||||
#endif
|
||||
Reference in New Issue
Block a user