Skip to content

Instantly share code, notes, and snippets.

View a-luna's full-sized avatar

Aaron Luna a-luna

View GitHub Profile
@a-luna
a-luna / ConsoleProgressBar.cs
Last active April 16, 2021 04:31 — forked from DanielSWolf/Program.cs
Progress bar for console applications, added the ability to customize the various components of the progress bar. Added the ability to display or hide the progress bar, percent complete and animation. And just for fun, I created a set of animation sequences which can be used instead of the default "|/-\-" progress indicator.
namespace AaronLuna.Common.Console
{
using System;
using System.Linq;
using System.Text;
using System.Threading;
public class ConsoleProgressBar : IDisposable, IProgress<double>
{
readonly TimeSpan _animationInterval = TimeSpan.FromSeconds(1.0 / 8);