Updated samples/demos to show usage of hide/show time elapsed/remaining

This commit is contained in:
Pranav Srinivas Kumar
2019-12-17 09:31:43 -06:00
parent 8198d8a802
commit 6224a46371
10 changed files with 72 additions and 43 deletions

View File

@@ -1,20 +1,22 @@
#include <chrono>
#include <indicators/block_progress_bar.hpp>
#include <thread>
#include <chrono>
int main() {
// Hide cursor
std::cout << "\e[?25l";
indicators::BlockProgressBar bar;
// Configure the bar
bar.set_bar_width(80);
bar.start_bar_with("[");
bar.end_bar_with("]");
bar.set_foreground_color(indicators::Color::WHITE);
bar.set_foreground_color(indicators::Color::WHITE);
bar.hide_elapsed_time();
bar.hide_remaining_time();
// Update bar state
auto progress = 0.0f;
while (true) {
@@ -26,7 +28,7 @@ int main() {
}
// Show cursor
std::cout << "\e[?25h";
std::cout << "\e[?25h";
return 0;
}