mirror of
https://github.com/p-ranav/indicators.git
synced 2025-12-16 04:18:51 +08:00
Update README.md
This commit is contained in:
21
README.md
21
README.md
@@ -127,12 +127,23 @@ int main() {
|
|||||||
bar.set_foreground_color(indicators::Color::GREEN);
|
bar.set_foreground_color(indicators::Color::GREEN);
|
||||||
|
|
||||||
// Update bar state
|
// Update bar state
|
||||||
size_t i = 0;
|
|
||||||
while (i < 101) {
|
bar.set_progress(10); // 10% done
|
||||||
bar.set_progress(i);
|
|
||||||
|
// do some work
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||||
i += 10;
|
|
||||||
}
|
bar.set_progress(30); // 30% done
|
||||||
|
|
||||||
|
// do some more work
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(600));
|
||||||
|
|
||||||
|
bar.set_progress(65); // 65% done
|
||||||
|
|
||||||
|
// do final bit of work
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(300));
|
||||||
|
|
||||||
|
bar.set_progress(100); // all done
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user