advance method

Future<void> advance(
  1. Duration duration
)

Move time forward and complete every sleep whose deadline was reached.

Implementation

Future<void> advance(Duration duration) async {
  if (duration.isNegative) {
    throw ArgumentError.value(duration, 'duration', 'must not be negative');
  }
  await advanceTo(_now.add(duration));
}