ProgressMeter

Track progress over time on text-based output device.

Constructors

this
this(size_t totalTicks, size_t printEveryMsecs, Format format, Flag!"silent" silent, Unit unit, size_t precision)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Aliases

UnitSpec
alias UnitSpec = Tuple!(size_t, "multiplier", char, "name")
Undocumented in source.
estimatedTimeOfArrivalSecs
alias estimatedTimeOfArrivalSecs = etaSecs

Compute estimated time of arrival (ETA) with a simple linear model.

hasEstimatedTimeOfArrival
alias hasEstimatedTimeOfArrival = hasETA

Returns true when etaSecs is defined.

Enums

Format
enum Format

Display format for the progress meter.

LineLocation
enum LineLocation
Undocumented in source.
Unit
enum Unit

Display unit for the progress meter.

isValidTimeUnit
eponymoustemplate isValidTimeUnit(string timeUnit)

Functions

printHumanProgressLine
void printHumanProgressLine(LineLocation lineLocation)
Undocumented in source. Be warned that the author may not have intended to support it.
printJsonProgressLine
void printJsonProgressLine(LineLocation lineLocation)
Undocumented in source. Be warned that the author may not have intended to support it.
printProgressLine
void printProgressLine(LineLocation lineLocation)
Undocumented in source. Be warned that the author may not have intended to support it.
start
void start()

Start the timer. Print the first status line if format is human.

stop
void stop()

Stop the timer. Prints a final status line.

tick
void tick(size_t newTicks)

Advance the number of ticks. Prints a status line when at least printEveryMsecs milliseconds have passed since the last print.

updateNumTicks
void updateNumTicks(size_t numTicks)

Set the number of ticks. Prints a status line when at least printEveryMsecs milliseconds have passed since the last print.

Properties

elapsed
auto elapsed [@property getter]
elapsedSecs
auto elapsedSecs [@property getter]
etaSecs
double etaSecs [@property getter]

Compute estimated time of arrival (ETA) with a simple linear model.

hasETA
auto hasETA [@property getter]

Returns true when etaSecs is defined.

isRunning
bool isRunning [@property getter]

Returns true if the timer is running.

numTicks
size_t numTicks [@property getter]
size_t numTicks [@property setter]

Current number of ticks. Automatically updates the status when the timer is running.

output
File output [@property setter]
File output [@property getter]

Get/set the output file.

ticksPerSec
auto ticksPerSec [@property getter]

Static functions

selectUnitFor
Unit selectUnitFor(size_t number)

Select unit such that number can be displayed with three leading decimal digits.

Variables

_numTicks
size_t _numTicks;
Undocumented in source.
_output
File _output;
Undocumented in source.
format
Format format;

Select output format.

hasOutput
bool hasOutput;
Undocumented in source.
lastPrint
StopWatch lastPrint;
Undocumented in source.
precision
size_t precision;

Number of digits of decimal fractions.

printEveryMsecs
size_t printEveryMsecs;

Print a progress update at most this frequently. Progress lines are only ever printed on start, stop, tick and updateNumTicks.

silent
Flag!"silent" silent;

Suppress all output but still keep track of things.

timer
StopWatch timer;
Undocumented in source.
totalTicks
size_t totalTicks;

Set this to the total number of ticks if known.

unit
Unit unit;

Display unit for format human.

Meta