chance: add lil_demo() fun
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-02-03 03:05:09 +01:00
parent ffd0180578
commit a6f9fb5e8c
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -54,6 +54,22 @@ auto sigterm_handler(int sig_n) -> void {
throw;
}
}
auto lil_demo() -> void {
using std::chrono_literals::operator""ms;
chance::f->random_data(4);
std::this_thread::sleep_for(120ms);
chance::f->random_data(3);
chance::f->random_data(3);
std::this_thread::sleep_for(10ms);
chance::f->random_data(3);
std::this_thread::sleep_for(5000ms);
chance::f->random_data(30);
std::this_thread::sleep_for(5000ms);
chance::f->random_data(30);
std::this_thread::sleep_for(2000ms);
chance::f->random_data(1000);
}
} // namespace chance
@ -69,17 +85,6 @@ int main() {
using std::chrono_literals::operator""ms;
chance::f->random_data(4); // number of bytes requested
std::this_thread::sleep_for(7777ms); // enough time for p0 == 64
chance::f->random_data(4);
std::this_thread::sleep_for(120ms);
chance::f->random_data(3);
chance::f->random_data(3);
std::this_thread::sleep_for(10ms);
chance::f->random_data(3);
std::this_thread::sleep_for(5000ms);
chance::f->random_data(30);
std::this_thread::sleep_for(5000ms);
chance::f->random_data(30);
std::this_thread::sleep_for(2000ms);
if (chance::AUTOSTOP) {
auto err{chance::f->stop_running()};