GClasses
|
This class is used with big loops to estimate the wall-clock time until completion. It works by computing the running median of the duration of recent iterations, and projecting that duration across the remaining iterations.
#include <GTime.h>
Public Member Functions | |
GProgressEstimator (size_t total_iters, size_t sampleSize=13) | |
~GProgressEstimator () | |
const char * | estimate (size_t iter) |
Protected Attributes | |
double | m_iterStartTime |
std::string | m_message |
double | m_prevMedian |
std::vector< double > | m_queue |
size_t | m_queuePos |
GIndexedMultiSet< double > | m_samples |
size_t | m_sampleSize |
double | m_startTime |
size_t | m_totalIters |
GClasses::GProgressEstimator::GProgressEstimator | ( | size_t | total_iters, |
size_t | sampleSize = 13 |
||
) |
GClasses::GProgressEstimator::~GProgressEstimator | ( | ) |
const char* GClasses::GProgressEstimator::estimate | ( | size_t | iter | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |