diff --git a/src/tools.cpp b/src/tools.cpp index 13c6530..a6e0da3 100644 --- a/src/tools.cpp +++ b/src/tools.cpp @@ -1388,7 +1388,22 @@ get_human_readable_timestamp(uint64_t ts) return std::string(buffer); } +void +pause_execution(uint64_t no_seconds, const string& text) +{ + + cout << "\nPausing " << text + << " for " << no_seconds << " seconds: " + << flush; + + for (size_t i = 0; i < no_seconds; ++i) + { + cout << "." << flush; + std::this_thread::sleep_for(std::chrono::seconds(1)); + } + cout << endl; +} } diff --git a/src/tools.h b/src/tools.h index cef73df..e3b9372 100644 --- a/src/tools.h +++ b/src/tools.h @@ -333,6 +333,9 @@ calc_median(It it_begin, It it_end) } +void +pause_execution(uint64_t no_seconds, const string& text = "now"); + } #endif //XMREG01_TOOLS_H