ProgressReport

class ProgressReport

Periodically report on the progress of long tasks and estimate remaining time to completion.

Public Functions

ProgressReport(argtype args = argtype())

args:

  • num: number of iterations (default: 1).

  • percent_per_write: report every this many percent progress made. (default: 1e-4 e.g., 0.001%)

  • double_percent_per_write: if 1, double the percent per write each write. Else if not 1, do not double (default: 1).

  • file_name: append report to this file. If empty, cout (default: empty).

void set_num(const int num)

Set the number of iterations to completion.

void reset()

Reset the progress report.

double percent() const

Return the current progress percentage.

void check()

Check on progress every iteration.

void write()

Write the report.

void serialize(std::ostream &ostr) const

Serialize object.

ProgressReport(std::istream &istr)

Deserialize object.