Class TimeKeeper

Class Documentation

class TimeKeeper

Class for tracking and reporting the processing time of various functions.

Public Functions

template<typename ...Reporters>
inline explicit TimeKeeper(Reporters... reporters)
void add_reporter(std::ostream *os)

Add a reporter to output processing times to an ostream.

Parameters:

os – Pointer to the ostream object

void add_reporter(rclcpp::Publisher<ProcessingTimeDetail>::SharedPtr publisher)

Add a reporter to publish processing times to an rclcpp publisher.

Parameters:

publisher – Shared pointer to the rclcpp publisher

void start_track(const std::string &func_name)

Start tracking the processing time of a function.

Parameters:

func_name – Name of the function to be tracked

void end_track(const std::string &func_name)

End tracking the processing time of a function.

Parameters:

func_name – Name of the function to end tracking

void comment(const std::string &comment)

Comment the current time node.

Parameters:

comment – Comment to be added to the current time node