xmreg::pause_execution added to tools.

This commit is contained in:
moneroexamples 2017-03-03 04:56:42 +00:00
parent 16fce8188c
commit 38d893057e
2 changed files with 18 additions and 0 deletions

View File

@ -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;
}
}

View File

@ -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