Skip to content

efar301/cpp_pbar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pbar

pbar is inspired by the python library tqdm, where you can wrap an iterable and get a fancy animated progressbar in the terminal.

I created my own version for c++ loops. It currently performs best with for loops, and a while version will come soon.

Demonstration

gif

The logic takes between 60ns and 80ns, but depends on your hardware. Benchmarking does not include the terminal operations (coloring, writing, and updating the progressbar).

Personalization

The color of the progressbar, the filler character for the progressbar, and the width is customizable. Colors are under Progressbar::Colors enum, the filler character can be changed with SetFiller(), and the width can be set with SetWidth().

Example Usage

#include "Progressbar.h"

int main() {
    Progressbar bar;

    for (int i = 0; i < 10; ++i) {
        bar.PrintProgress(i + 1, 10);
    }

    return 0;
}

Requirements

As long as your terminal supports ANSI escape characters, carriage return: \r, and newline: \n then this will work.

About

A loop progressbar created in c++. Call it in any loop to get an animated progressbar.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published