Last active
April 4, 2024 17:22
-
-
Save iapicca/83b784ff7d0c8345a599600584b1710f to your computer and use it in GitHub Desktop.
Future.wait behavior
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
void main() async { | |
final futures = [ | |
for (var i = 0; i < 100000; ++i) Future.sync(DateTime.now), | |
]; | |
final dateTimes = await Future.wait(futures); | |
final delta = dateTimes.last.difference(dateTimes.first); | |
print(delta.inMilliseconds); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment