cgv
Loading...
Searching...
No Matches
cgv::utils::Profiler< T > Class Template Reference

A profiler class for managing different stopwatches. More...

#include <profiler.h>

Public Member Functions

void prepare_counter (const T &handle)
 
double * get_time_accu (const T handle)
 
void zero_counters ()
 

Friends

std::ostream & operator<< (std::ostream &out, Profiler p)
 

Detailed Description

template<typename T = std::string>
class cgv::utils::Profiler< T >

A profiler class for managing different stopwatches.

Example:

Profiler<> p;

p.prepare_counter("all"); p.prepare_counter("graphics"); p.prepare_counter("simulation");

... while(not_stopped) { stopwatch sa(p.get_time_accu("all")); { stopwatch ss(p.get_time_accu("simulation")); simulate(); } { stopwatch sr(p.get_time_accu("graphics")); render(); } } ... std::cout << p;

Definition at line 44 of file profiler.h.

Member Function Documentation

◆ get_time_accu()

template<typename T = std::string>
double * cgv::utils::Profiler< T >::get_time_accu ( const T  handle)
inline

Definition at line 58 of file profiler.h.

◆ prepare_counter()

template<typename T = std::string>
void cgv::utils::Profiler< T >::prepare_counter ( const T &  handle)
inline

Definition at line 51 of file profiler.h.

◆ zero_counters()

template<typename T = std::string>
void cgv::utils::Profiler< T >::zero_counters ( )
inline

Definition at line 64 of file profiler.h.

Friends And Related Symbol Documentation

◆ operator<<

template<typename T = std::string>
std::ostream & operator<< ( std::ostream &  out,
Profiler< T >  p 
)
friend

Definition at line 75 of file profiler.h.


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