HLCC Documentation 2.2.0
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | List of all members
hlcc::trksim::ExecTimeStats Class Reference

#include <executionStatistics.hpp>

Classes

struct  StatisticsCollection
 
struct  StatisticsData
 

Public Member Functions

 ExecTimeStats (std::string p_name, uint16_t p_buf_size)
 
void TimerStart ()
 
void TimerStop ()
 
std::string GetName ()
 
StatisticsData GetStatsData ()
 
std::string PrintStats ()
 

Static Public Member Functions

static std::string PrintCollection (const std::vector< StatisticsCollection > &collection)
 
static std::string DurationAsString (uint64_t time_ns)
 

Detailed Description

Class used to help measure program execution time, it ca acquire the results of multiple execution iterations and produce statistics about the results and format data to be printed.

Constructor & Destructor Documentation

◆ ExecTimeStats()

hlcc::trksim::ExecTimeStats::ExecTimeStats ( std::string p_name,
uint16_t p_buf_size )

Constructor

Parameters
p_namestring, with the name of current instance
p_buf_sizeuint16_t with the buffer size. Once the buffer is full older data will be overwritten with new data.

Member Function Documentation

◆ DurationAsString()

std::string hlcc::trksim::ExecTimeStats::DurationAsString ( uint64_t time_ns)
static

Convert a time in ns given as a uint64_t to the best string representation.

◆ GetName()

std::string hlcc::trksim::ExecTimeStats::GetName ( )
inline

Returns the name given to the current instance

Returns
string, with name of instance.

◆ GetStatsData()

ExecTimeStats::StatisticsData hlcc::trksim::ExecTimeStats::GetStatsData ( )

Compute statistics from the data in the buffer and return results

Returns
StatisticsData, with statistics data.

◆ PrintCollection()

std::string hlcc::trksim::ExecTimeStats::PrintCollection ( const std::vector< StatisticsCollection > & collection)
static

Print statistics data for multiple timers in a table. It prints data from timers in the c++ and python side for easy comparison.

Returns
string, with statistics data formatted to be printed on the screen.

◆ PrintStats()

std::string hlcc::trksim::ExecTimeStats::PrintStats ( )

Print the statistics of the current instance.

Returns
string, with statistics data formatted to print on the screen.

◆ TimerStart()

void hlcc::trksim::ExecTimeStats::TimerStart ( )

A call to this method should be placed in the beginning of the code we want to monitor. There should only be one call to this method per instance.

◆ TimerStop()

void hlcc::trksim::ExecTimeStats::TimerStop ( )

A call to this method should be placed in the end of the code we want to monitor. There should only be one call to this method per instance.


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