Struct Logger::Task

Nested Relationships

This struct is a nested type of Class Logger.

Struct Documentation

struct Task

Stores timing metrics for a named code section.

Public Functions

Task(std::chrono::steady_clock::time_point start)

Construct a new Task object and start timing.

Parameters:

start – Start time point.

void activate(std::chrono::steady_clock::time_point now)

Activate (start) the timer.

Parameters:

now – Current time point.

std::chrono::duration<double> stop(std::chrono::steady_clock::time_point now)

Stop the timer and update statistics.

Parameters:

now – Current time point.

Returns:

Duration of this run.

Public Members

bool active

True if the timer is running.

std::chrono::steady_clock::time_point start_time

Start time of the task.

std::chrono::duration<double> last_duration

Duration of the last run.

std::chrono::duration<double> max_duration

Maximum duration recorded.

std::chrono::duration<double> total_time_active

Total accumulated time.

int count

Number of times the task was timed.