mirror of
https://github.com/p-ranav/indicators.git
synced 2025-12-13 02:28:53 +08:00
32 lines
804 B
C++
32 lines
804 B
C++
#include <chrono>
|
|
#include <indicators/progress_bar.hpp>
|
|
#include <thread>
|
|
|
|
int main() {
|
|
indicators::ProgressBar bar{
|
|
indicators::option::BarWidth{50},
|
|
indicators::option::Start{" ["},
|
|
indicators::option::Fill{"█"},
|
|
indicators::option::Lead{"█"},
|
|
indicators::option::Remainder{"-"},
|
|
indicators::option::End{"]"},
|
|
indicators::option::PrefixText{"Training Gaze Network 👀"},
|
|
indicators::option::ForegroundColor{indicators::Color::yellow},
|
|
indicators::option::ShowElapsedTime{true},
|
|
indicators::option::ShowRemainingTime{true},
|
|
};
|
|
|
|
// Update bar state
|
|
while (true) {
|
|
bar.tick();
|
|
if (bar.is_completed())
|
|
break;
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
|
}
|
|
|
|
// Show cursor
|
|
std::cout << "\e[?25h";
|
|
|
|
return 0;
|
|
}
|