sleep function

Future<void> sleep(
  1. Duration d
)

Implementation

Future<void> sleep(Duration d) {
  final c = Completer<void>();
  Timer(d, () => c.complete());
  return c.future;
}