GEOS  3.9.1dev
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
geos::util::Profile Class Reference

#include <profiler.h>

Public Types

using timeunit = std::chrono::microseconds
 

Public Member Functions

 Profile (std::string name)
 Create a named profile. More...
 
 ~Profile ()=default
 Destructor. More...
 
void start ()
 start a new timer More...
 
void stop ()
 stop current timer More...
 
double getMax () const
 Return Max stored timing. More...
 
double getMin () const
 Return Min stored timing. More...
 
double getTot () const
 Return total timing. More...
 
std::string getTotFormatted () const
 Return total timing. More...
 
double getAvg () const
 Return average timing. More...
 
size_t getNumTimings () const
 Return number of timings. More...
 

Public Attributes

std::string name
 Profile name. More...
 

Private Attributes

std::chrono::high_resolution_clock::time_point starttime
 
std::chrono::high_resolution_clock::time_point stoptime
 
std::vector< timeunittimings
 
timeunit totaltime
 
timeunit max
 
timeunit min
 
double avg
 

Detailed Description

Definition at line 45 of file profiler.h.

Member Typedef Documentation

using geos::util::Profile::timeunit = std::chrono::microseconds

Definition at line 47 of file profiler.h.

Constructor & Destructor Documentation

geos::util::Profile::Profile ( std::string  name)

Create a named profile.

geos::util::Profile::~Profile ( )
default

Destructor.

Member Function Documentation

double geos::util::Profile::getAvg ( ) const

Return average timing.

double geos::util::Profile::getMax ( ) const

Return Max stored timing.

double geos::util::Profile::getMin ( ) const

Return Min stored timing.

size_t geos::util::Profile::getNumTimings ( ) const

Return number of timings.

double geos::util::Profile::getTot ( ) const

Return total timing.

std::string geos::util::Profile::getTotFormatted ( ) const

Return total timing.

void geos::util::Profile::start ( )
inline

start a new timer

Definition at line 57 of file profiler.h.

void geos::util::Profile::stop ( )
inline

stop current timer

Definition at line 64 of file profiler.h.

Member Data Documentation

double geos::util::Profile::avg
private

Definition at line 127 of file profiler.h.

timeunit geos::util::Profile::max
private

Definition at line 121 of file profiler.h.

timeunit geos::util::Profile::min
private

Definition at line 124 of file profiler.h.

std::string geos::util::Profile::name

Profile name.

Definition at line 106 of file profiler.h.

std::chrono::high_resolution_clock::time_point geos::util::Profile::starttime
private

Definition at line 112 of file profiler.h.

std::chrono::high_resolution_clock::time_point geos::util::Profile::stoptime
private

Definition at line 112 of file profiler.h.

std::vector<timeunit> geos::util::Profile::timings
private

Definition at line 115 of file profiler.h.

timeunit geos::util::Profile::totaltime
private

Definition at line 118 of file profiler.h.


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