Vesper 0.5.1
Vesper is short form for the Latin word for "Bat", as Vesper is designed to be small, lightweight, and easily handle things like particles and flocking behaviors in accordance with the nature of bats. \n It is meant to be a particle simulation, VFX editor, and CAN be used secondarily as a small game engine.
GitHub | Vesper Updates | Creator
Loading...
Searching...
No Matches
Vesper::InstrumentationTimer Class Reference

#include <Instrumentor.h>

Public Member Functions

 InstrumentationTimer (const char *name)
 ~InstrumentationTimer ()
void Stop ()

Private Attributes

const char * m_Name
std::chrono::time_point< std::chrono::high_resolution_clock > m_StartTimepoint
bool m_Stopped

Constructor & Destructor Documentation

◆ InstrumentationTimer()

Vesper::InstrumentationTimer::InstrumentationTimer ( const char * name)
inline
149 : m_Name(name), m_Stopped(false)
150 {
151 m_StartTimepoint = std::chrono::high_resolution_clock::now();
152 }
bool m_Stopped
Definition Instrumentor.h:175
std::chrono::time_point< std::chrono::high_resolution_clock > m_StartTimepoint
Definition Instrumentor.h:174
const char * m_Name
Definition Instrumentor.h:173

◆ ~InstrumentationTimer()

Vesper::InstrumentationTimer::~InstrumentationTimer ( )
inline
155 {
156 if (!m_Stopped)
157 Stop();
158 }
void Stop()
Definition Instrumentor.h:160

Member Function Documentation

◆ Stop()

void Vesper::InstrumentationTimer::Stop ( )
inline
161 {
162 auto endTimepoint = std::chrono::high_resolution_clock::now();
163
164 long long start = std::chrono::time_point_cast<std::chrono::microseconds>(m_StartTimepoint).time_since_epoch().count();
165 long long end = std::chrono::time_point_cast<std::chrono::microseconds>(endTimepoint).time_since_epoch().count();
166
167 uint32_t threadID = std::hash<std::thread::id>{}(std::this_thread::get_id());
168 Instrumentor::Get().WriteProfile({ m_Name, start, end, threadID });
169
170 m_Stopped = true;
171 }
static Instrumentor & Get()
Definition Instrumentor.h:138
void WriteProfile(const ProfileResult &result)
Definition Instrumentor.h:90

Member Data Documentation

◆ m_Name

const char* Vesper::InstrumentationTimer::m_Name
private

◆ m_StartTimepoint

std::chrono::time_point<std::chrono::high_resolution_clock> Vesper::InstrumentationTimer::m_StartTimepoint
private

◆ m_Stopped

bool Vesper::InstrumentationTimer::m_Stopped
private

The documentation for this class was generated from the following file: