Class time_check

Class Documentation

class time_check

Tool for program execution checkpointing.

Public Types

typedef unsigned size_type

Public Functions

time_check(const char *name = "", size_type n = 128)

Constructs time_check.

Parameters
  • name: name of the object.

  • n: maximal number of check points.

size_type size() const

Return

number of stored checkpoints.

size_type capacity() const

Return

maximal number of checkpoints.

void start()

Starts checkpointing.

void stop()

Stops checkpointing.

void check(const std::string &id = "")

Creates checkpoint.

Parameters
  • id: name of the checkpoint.

double total() const

Return

time from start() to stop().

double at_point(size_type n) const

Return

time between points n and n-1.

double to_point(size_type n) const

Return

time to point n.

std::string point_id(size_type n) const

Return

id of the n’th point

double get_time() const

Friends

friend std::ostream &operator<<(std::ostream&, const time_check&)