add debug timer macro.
This commit is contained in:
Binary file not shown.
@@ -1,10 +1,18 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
|
#include "Common.h"
|
||||||
#include "IUnityInterface.h"
|
#include "IUnityInterface.h"
|
||||||
|
|
||||||
|
|
||||||
|
// Debug flag
|
||||||
|
#define UDD_DEBUG_ON
|
||||||
|
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
class Debug
|
class Debug
|
||||||
{
|
{
|
||||||
@@ -134,3 +142,14 @@ private:
|
|||||||
static DebugLogFuncPtr errFunc_;
|
static DebugLogFuncPtr errFunc_;
|
||||||
static std::mutex mutex_;
|
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