SpiecsEngine
 
Loading...
Searching...
No Matches
ScopeTimer.h
Go to the documentation of this file.
1/**
2* @file ScopeTimer.h
3* @brief The ScopeTimer Class Definitions.
4* @author Spices.
5*/
6
7#pragma once
8#include "Core/Core.h"
9#include <chrono>
10
11namespace Spices {
12
13 /**
14 * @brief This class helps recording scope time and output logs.
15 */
17 {
18 public:
19
20 /**
21 * @brief Constructor Function.
22 * @param[in] log .
23 */
24 ScopeTimer(const std::string& log);
25
26 /**
27 * @brief Destructor Function.
28 */
29 virtual ~ScopeTimer();
30
31 private:
32
33 /**
34 * @brief In Scope time.
35 */
36 std::chrono::steady_clock::time_point m_InTime;
37
38 /**
39 * @brief Leave Scope time.
40 */
41 std::chrono::steady_clock::time_point m_LeaveTime;
42
43 /**
44 * @brief Logs.
45 */
46 std::string m_Log;
47 };
48
49#define SCOPE_TIME_COUNTER(...) ::Spices::ScopeTimer thisScopeTimeCounter(__VA_ARGS__);
50
51}
std::chrono::steady_clock::time_point m_InTime
In Scope time.
Definition ScopeTimer.h:36
virtual ~ScopeTimer()
Destructor Function.
ScopeTimer(const std::string &log)
Constructor Function.
std::string m_Log
Logs.
Definition ScopeTimer.h:46
std::chrono::steady_clock::time_point m_LeaveTime
Leave Scope time.
Definition ScopeTimer.h:41
This class helps recording scope time and output logs.
Definition ScopeTimer.h:17