gg_fake_stopwatch

Last updated:

0 purchases

gg_fake_stopwatch Image
gg_fake_stopwatch Images
Add to Cart

Description:

gg fake stopwatch

GgFakeStopWatch #
The default stopwatch implementation does not work correctly when used in
a FakeAsync callback. With GgFakeStopwatch this is sovled.
Usage #
// Instantiate a fake `FakeAsync` callback.
fakeAsync((fakeAsync) {
// Create a GgFakeStopwatch instance handing over the fakeAsync instance.
final stopwatch = GgFakeStopwatch(fakeAsync: fakeAsync);

// Start the stopwatch
stopwatch.start();

// Elapse some time
fakeAsync.elapse(Duration(seconds: 1));

// Stopwatch.elapsed is in sync with fakeAsync.elapsed:
assert(fakeAsync.elapsed == stopwatch.elapsed);
});
copied to clipboard
Features and bugs #
Please file feature requests and bugs at GitHub.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.