sleep function

Future sleep({
  1. int seconds = 1,
  2. bool debug = false,
})

Utility function to wait for any Future to complete.

Implementation

Future sleep({
  int seconds = 1,
  bool debug = false,
}) async {
  if (debug) print('\n....   Sleeping for $seconds second(s)    ....\n');
  await Future.delayed(Duration(seconds: seconds));
  if (debug) print('\n....           Woke up!          ....\n');
}