https://github.com/soraxas/cppm
Progress monitor for C++, with fancy bar, speed monitor, and estimated time to finish
https://github.com/soraxas/cppm
cpp cpp11 progress-bar progress-monitoring tqdm
Last synced: 3 months ago
JSON representation
Progress monitor for C++, with fancy bar, speed monitor, and estimated time to finish
- Host: GitHub
- URL: https://github.com/soraxas/cppm
- Owner: soraxas
- License: mit
- Created: 2020-11-08T08:03:55.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-04T23:48:49.000Z (over 2 years ago)
- Last Synced: 2025-02-23T06:51:20.584Z (3 months ago)
- Topics: cpp, cpp11, progress-bar, progress-monitoring, tqdm
- Language: C++
- Homepage:
- Size: 133 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CPPM: C++ Program Progress Monitor
`cppm` is a **c++ monitor** for monitoring progress of loops, inspired by [tqdm](https://github.com/tqdm/tqdm). The [official](https://github.com/tqdm/tqdm.cpp) c++ port lacks a lot of features and is not being maintained. `cppm` aims to provide an easy-to-use header-only file to be dropped in any c++ project for monitoring program progress.
This is useful if you need to run some process and would like to monitor the progress of some loop. For most cases, it will display:
- speed of iterations per second
- current percentage
- progress bar
- elapsed time
- estimated remaining time`cppm` uses syntax upto C++11.
# Quick install
You can use the following in your CMakeLists.txt
```cmake
include(FetchContent)
# ==================================================
set (EXT_CPPM "ext_cppm")
FetchContent_Declare (
${EXT_CPPM}PREFIX ${EXT_CPPM}
GIT_REPOSITORY https://github.com/soraxas/cppm
GIT_TAG 2e946ee1261b61b955d55b5d405410f34fb8ce4a
GIT_SHALLOW ONBUILD_ALWAYS OFF
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/ext/${EXT_CPPM}CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=)
FetchContent_MakeAvailable(${EXT_CPPM})
# ==================================================# ......
# ......target_link_libraries(${PROJECT_NAME} cppm)
target_include_directories(${PROJECT_NAME} PRIVATE $)
```# Usage
`cppm` can be used as a monitor without explicit size, of which it will display the speed of the iterations per second.
```c++
auto pbar = cppm::pm(n);
for (...) {
...
pbar.update();
}
pbar.finish();
```# Acknowledgement
The main `cppm`'s header only structure is based upon [cpptqdm](https://github.com/aminnj/cpptqdm), including the theme of the fancy progress bar. In addition, the wrapping of iterable container is inspired by [tqdm-cpp](https://gitlab.com/miguelraggi/tqdm-cpp).