Leviathan  0.8.0.0
Leviathan game engine
Leviathan::ScopeTimer Class Reference

#include <TimingMonitor.h>

Public Member Functions

DLLEXPORT ScopeTimer (const std::string &source)
 
DLLEXPORT ~ScopeTimer ()
 

Protected Attributes

std::string TimerName
 
std::string Source
 

Static Protected Attributes

static int CurID = 42
 

Detailed Description

Definition at line 58 of file TimingMonitor.h.

Constructor & Destructor Documentation

◆ ScopeTimer()

DLLEXPORT Leviathan::ScopeTimer::ScopeTimer ( const std::string &  source)

Definition at line 95 of file TimingMonitor.cpp.

95  {
96  // create unique name for this timer //
97  CurID++;
99  Source = source;
100  // start timer for this object //
102 }
static DLLEXPORT void StartTiming(const std::string &name, int style=TIMINGMONITOR_STYLE_RESULT_DEFAULT)
static std::string ToString(const T &val)
Definition: Convert.h:72
#define TIMINGMONITOR_STYLE_RESULT_NONE
Definition: TimingMonitor.h:10
#define BASETIMERNAME_FOR_SCROPE_TIMER
Definition: TimingMonitor.h:22

◆ ~ScopeTimer()

DLLEXPORT Leviathan::ScopeTimer::~ScopeTimer ( )

Definition at line 104 of file TimingMonitor.cpp.

104  {
105  // kill this timer //
106  int ElapsedTime = TimingMonitor::StopTiming(TimerName, false);
107 
108  // print data //
109  Logger::Get()->Info("ScopeTimer: "+Source+" Stopped elapsed: "+
110  Convert::ToString(ElapsedTime/1000000.f)+" s ("+
111  Convert::ToString(ElapsedTime)+" micro seconds)");
112 }
DLLEXPORT void Info(const std::string &data) override
Definition: Logger.cpp:164
static DLLEXPORT int StopTiming(const std::string &name, bool printoutput=true)
static std::string ToString(const T &val)
Definition: Convert.h:72
static DLLEXPORT Logger * Get()
Definition: Logger.cpp:106

Member Data Documentation

◆ CurID

int Leviathan::ScopeTimer::CurID = 42
staticprotected

Definition at line 66 of file TimingMonitor.h.

◆ Source

std::string Leviathan::ScopeTimer::Source
protected

Definition at line 64 of file TimingMonitor.h.

◆ TimerName

std::string Leviathan::ScopeTimer::TimerName
protected

Definition at line 63 of file TimingMonitor.h.


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