-
-
Save ericgrandt/ff9f18541183586bc090696f756c2ad0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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