Skip to content

Instantly share code, notes, and snippets.

@ericgrandt
Created May 6, 2019 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericgrandt/ff9f18541183586bc090696f756c2ad0 to your computer and use it in GitHub Desktop.
Save ericgrandt/ff9f18541183586bc090696f756c2ad0 to your computer and use it in GitHub Desktop.
// Without asynchronous operations
import 'dart:async';
main() {
longOperation();
printSomething();
}
longOperation() {
Duration delay = Duration(seconds: 3);
Future.delayed(delay);
print('Waited 3 seconds to print this and blocked execution.');
}
printSomething() {
print('That sure took a while!');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment