From 38d893057ed05334e0faf01430d4fdab1f09953c Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Fri, 3 Mar 2017 04:56:42 +0000 Subject: [PATCH] xmreg::pause_execution added to tools. --- src/tools.cpp | 15 +++++++++++++++ src/tools.h | 3 +++ 2 files changed, 18 insertions(+) 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