SpiecsEngine
 
Loading...
Searching...
No Matches
ScopeTimer.cpp
Go to the documentation of this file.
1/**
2* @file ScopeTimer.cpp.
3* @brief The ScopeTimer Class Implementation.
4* @author Spices.
5*/
6
7#include "Pchheader.h"
8#include "ScopeTimer.h"
9
10namespace Spices {
11
12 Spices::ScopeTimer::ScopeTimer(const std::string& log)
13 : m_Log(log)
14 {
15 /**
16 * @brief Init In Time.
17 */
18 m_InTime = std::chrono::high_resolution_clock::now();
19 }
20
22 {
23 /**
24 * @brief Init Leave Time.
25 */
26 m_LeaveTime = std::chrono::high_resolution_clock::now();
27
28 std::stringstream ss;
29 ss << "ScopeTimer : " << std::chrono::duration<float, std::chrono::milliseconds::period>(m_LeaveTime - m_InTime).count() << " milliseconds " << m_Log;
30
31 SPICES_CORE_INFO(ss.str())
32 }
33
34}
virtual ~ScopeTimer()
Destructor Function.
ScopeTimer(const std::string &log)
Constructor Function.
std::string m_Log
Logs.
Definition ScopeTimer.h:46
This class helps recording scope time and output logs.
Definition ScopeTimer.h:17