26 #if defined(_WIN32) && defined(HR_ENGINE_SHARED) 28 # define MR_DllDeclare __declspec( dllexport ) 30 # define MR_DllDeclare __declspec( dllimport ) 33 # define MR_DllDeclare 50 using clock_t = std::chrono::high_resolution_clock;
51 using dur_t = std::chrono::nanoseconds;
68 if ((--(profiler.sampling)) == 0) {
69 profiler.dur += (clock_t::now() - profiler.sampleStart);
87 pctParent(
std::numeric_limits<double>::quiet_NaN()) { }
94 const std::string &
GetName()
const {
return name; }
109 std::shared_ptr<Profiler> AddSub(
const std::string &name);
114 std::vector<std::shared_ptr<Profiler>>
subs;
131 static boost::format fmt(
"%0.2f%% (%d)");
LapTime lap
Definition: Profiler.h:117
double pctParent
Definition: Profiler.h:90
dur_t dur
Definition: Profiler.h:112
const LapTime & GetOtherTime() const
Retrieve the unaccounted-for time from the last call to Lap().
Definition: Profiler.h:102
std::chrono::high_resolution_clock clock_t
Definition: Profiler.h:50
Profiler & profiler
Definition: Profiler.h:80
clock_t::time_point sampleStart
Definition: Profiler.h:116
std::string name
Definition: Profiler.h:113
Definition: Profiler.h:53
~Sampler()
Definition: Profiler.h:66
const std::string & GetName() const
Definition: Profiler.h:94
dur_t time
Definition: Profiler.h:89
LapTime otherTime
Definition: Profiler.h:118
std::ostream & operator<<(std::ostream &os, const Clock &clock)
Definition: Clock.h:115
int sampling
Definition: Profiler.h:115
Simple profiler.
Definition: Profiler.h:43
std::chrono::nanoseconds dur_t
Definition: Profiler.h:51
std::vector< std::shared_ptr< Profiler > > subs
Definition: Profiler.h:114
dur_t GetDuration() const
Definition: Profiler.h:95
const LapTime & GetLastLap() const
Definition: Profiler.h:96
Definition: Announcement.h:24
Sampler(Profiler &profiler)
Definition: Profiler.h:58
#define MR_DllDeclare
Definition: Profiler.h:33
Definition: Profiler.h:83
LapTime()
Definition: Profiler.h:85