Skip to content

Utilities ProgressTicker

Adam Bajguz edited this page Aug 18, 2020 · 1 revision

Typin comes with a simple utility for reporting progress to the console, ProgressTicker, which renders progress in-place on every tick.

It implements a well-known IProgress<double> interface so you can pass it to methods that are aware of this abstraction.

To avoid polluting output when it's not bound to a console, ProgressTicker will simply no-op if stdout is redirected.

var progressTicker = console.CreateProgressTicker();

for (var i = 0.0; i <= 1; i += 0.01)
    progressTicker.Report(i);
Clone this wiki locally