Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aminnj/cpptqdm
(unofficial) tqdm-like single header c++ pretty progress bar
https://github.com/aminnj/cpptqdm
cpp progressbar tqdm
Last synced: 11 days ago
JSON representation
(unofficial) tqdm-like single header c++ pretty progress bar
- Host: GitHub
- URL: https://github.com/aminnj/cpptqdm
- Owner: aminnj
- License: mit
- Created: 2018-05-26T23:49:59.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-04T09:25:05.000Z (5 months ago)
- Last Synced: 2024-10-13T19:47:57.200Z (24 days ago)
- Topics: cpp, progressbar, tqdm
- Language: C++
- Homepage:
- Size: 560 KB
- Stars: 204
- Watchers: 6
- Forks: 33
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## cpptqdm
Python `tqdm` is nice. Need something similar for C++. That's this.
#### Simple usage
```cpp
#include "tqdm.h"tqdm bar;
for(int i = 0; i < N; i++) {
bar.progress(i, N);
// stuff
}
bar.finish();
```#### Looks like
```
█████████████████▍ | 46.2% [4200000 | 103.66 kHz | 35s<47s]
```#### See it live
```bash
g++ test.cpp -std=c++11 && ./a.out
```![example](images/example.gif)
### FAQ
#### Won't this slow down my loops?
If your loops are faster than ~200MHz, then maybe!
#### Themes?
You bet. `set_theme_basic(), set_theme_line(), set_theme_circles()`.
#### *For fun*, what if I wanted to use this in python?
If you have ROOT, you can do the following. Note that
due to the fact it uses ROOT to call C++ code in
Python, loops faster than 1kHz start to get slowed
down by the overhead.
```python
import time
import ROOT as rr.gROOT.ProcessLine(".L tqdm.h")
bar = r.tqdm()
N = 10000
for i in range(N):
bar.progress(i,N)
time.sleep(0.001)
```