Skip to content

Instantly share code, notes, and snippets.

@geektoni
Last active March 16, 2017 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geektoni/83941b889cecb5df0d50638880960249 to your computer and use it in GitHub Desktop.
Save geektoni/83941b889cecb5df0d50638880960249 to your computer and use it in GitHub Desktop.
Shogun's Progress Bar
1) Base features:
- UTF-8/ASCII progress bar mode switch (prevents Windows madness);
- Display current SG_PROGRESS information (maybe others like iterations/second);
- Three range types:
-> prange(0, 100): range with bound;
-> prange(100): range with upper bound;
-> prange(it.begin(), it.end()): range using an iterators (range over a custom set of values);
-> prange_mt(100): range multi-threaded;
2) Possible other features:
- Add a "pretty" print mode;
- Specify the char used for the progress bar;
- Resizable progress bar (since only \n and \r will be used the user can blow things up by changing the terminal size);
3) Example (future) usage:
for (auto i : prange(0, 100)) {
/* Do stuff */
}
for (auto i : prange(0, 100, "pretty")) {
/* Do fancier stuff */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment