Doxygen
Loading...
Searching...
No Matches
Statistics Class Reference

Classes

struct  stat

Public Member Functions

 Statistics ()
void begin (const char *name)
void end ()
void print ()

Private Attributes

std::vector< statstats
std::chrono::steady_clock::time_point startTime

Detailed Description

Definition at line 233 of file doxygen.cpp.

Constructor & Destructor Documentation

◆ Statistics()

Statistics::Statistics ( )
inline

Definition at line 236 of file doxygen.cpp.

236{}

Member Function Documentation

◆ begin()

void Statistics::begin ( const char * name)
inline

Definition at line 237 of file doxygen.cpp.

238 {
239 msg("{}", name);
240 stats.emplace_back(name,0);
241 startTime = std::chrono::steady_clock::now();
242 }
std::vector< stat > stats
Definition doxygen.cpp:273
std::chrono::steady_clock::time_point startTime
Definition doxygen.cpp:274
#define msg(fmt,...)
Definition message.h:94

References msg, startTime, and stats.

Referenced by generateOutput(), parseInput(), and searchInputFiles().

◆ end()

void Statistics::end ( )
inline

Definition at line 243 of file doxygen.cpp.

244 {
245 std::chrono::steady_clock::time_point endTime = std::chrono::steady_clock::now();
246 stats.back().elapsed = static_cast<double>(std::chrono::duration_cast<
247 std::chrono::microseconds>(endTime - startTime).count())/1000000.0;
248 warn_flush();
249 }
void warn_flush()
Definition message.cpp:226

References startTime, stats, and warn_flush().

Referenced by generateOutput(), parseInput(), and searchInputFiles().

◆ print()

void Statistics::print ( )
inline

Definition at line 250 of file doxygen.cpp.

251 {
252 bool restore=false;
254 {
256 restore=true;
257 }
258 msg("----------------------\n");
259 for (const auto &s : stats)
260 {
261 msg("Spent {:.6f} seconds in {}",s.elapsed,s.name);
262 }
263 if (restore) Debug::setFlag(Debug::Time);
264 }
@ Time
Definition debug.h:36
static void clearFlag(const DebugMask mask)
Definition debug.cpp:122
static bool isFlagSet(const DebugMask mask)
Definition debug.cpp:132
static void setFlag(const DebugMask mask)
Definition debug.cpp:117

References Debug::clearFlag(), Debug::isFlagSet(), msg, Debug::setFlag(), stats, and Debug::Time.

Referenced by generateOutput().

Member Data Documentation

◆ startTime

std::chrono::steady_clock::time_point Statistics::startTime
private

Definition at line 274 of file doxygen.cpp.

Referenced by begin(), and end().

◆ stats

std::vector<stat> Statistics::stats
private

Definition at line 273 of file doxygen.cpp.

Referenced by begin(), end(), and print().


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