mirror of
https://github.com/p-ranav/indicators.git
synced 2025-12-16 04:18:51 +08:00
Minor updates
This commit is contained in:
@@ -235,6 +235,27 @@ int main() {
|
|||||||
thread.join();
|
thread.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::cout << "Compiling code\n";
|
||||||
|
{
|
||||||
|
indicator::ProgressSpinner p;
|
||||||
|
p.set_prefix_text("- ");
|
||||||
|
p.set_postfix_text("Checking project dependencies");
|
||||||
|
p.set_foreground_color(indicator::Color::WHITE);
|
||||||
|
p.set_spinner_states({"▖", "▘", "▝", "▗"});
|
||||||
|
auto job = [&p]() {
|
||||||
|
while (true) {
|
||||||
|
if (p.is_completed()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
p.tick();
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(60));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
std::thread thread(job);
|
||||||
|
thread.join();
|
||||||
|
}
|
||||||
|
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
|
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
|
||||||
|
|
||||||
// Show cursor
|
// Show cursor
|
||||||
|
|||||||
Reference in New Issue
Block a user