7#ifndef __PFUNCTIONPERF_H__
8#define __PFUNCTIONPERF_H__
24 void setName(
const std::string & name);
25 void resize(
size_t nbThread);
27 void start(
size_t threadIndex = 0lu);
28 void stop(
size_t threadIndex = 0lu);
29 void reset(
size_t threadIndex);
32 void getPerf(
size_t & nbCall,
double & fullTime,
double & averageTime,
double & stdTime,
size_t & minTime,
size_t & maxTime)
const;
33 const std::string &
getName()
const;
35 void print(std::ostream & out = std::cout)
const;
36 void printCsv(std::ostream & out = std::cout)
const;
void resize(size_t nbThread)
Resize the PFunctionPerf by respect to the number of thread which call the function.
PFunctionPerf & operator=(const PFunctionPerf &other)
Definition of equal operator of PFunctionPerf.
void stop(size_t threadIndex=0lu)
Stop the timing of one function.
std::string p_name
Name of the function to profile.
void printCsv(std::ostream &out=std::cout) const
Print the performance of the function in CSV format.
void print(std::ostream &out=std::cout) const
Print the performance of the function.
void copyPFunctionPerf(const PFunctionPerf &other)
Copy function of PFunctionPerf.
virtual ~PFunctionPerf()
Destructor of PFunctionPerf.
void setName(const std::string &name)
Set the name of the function profiled by the current PFunctionPerf.
PFunctionPerf(const std::string &name="")
Default constructor of PFunctionPerf.
std::vector< double > p_fullTime
Full time of execution for the current function (compute the averaged time with nbCall)
std::vector< size_t > p_maxTime
Maximum execution time.
void getPerf(size_t &nbCall, double &fullTime, double &averageTime, double &stdTime, size_t &minTime, size_t &maxTime) const
Get the performances of the current function.
std::vector< double > p_fullSqrTime
Sum of all square times (used to compute standard deviation)
void start(size_t threadIndex=0lu)
Start the timing for one function.
std::vector< size_t > p_nbCall
Number of calls of the current function.
const std::string & getName() const
Get the name of the function to profile.
void initialisationPFunctionPerf(const std::string &name)
Initialisation function of the class PFunctionPerf.
std::vector< size_t > p_minTime
Minimum execution time.
std::vector< size_t > p_timeBegin
Begin time of the current performance evaluation.
void reset()
Reset the profiling.