sleep method

Future<void> sleep(
  1. int seconds, [
  2. int microseconds = 0
])

Sleeps for a specified number of seconds.

Optionally accepts microseconds for finer control.

Implementation

Future<void> sleep(int seconds, [int microseconds = 0]) async {
  await Future.delayed(Duration(
    seconds: seconds,
    microseconds: microseconds,
  ));
}