Skip to content

Instantly share code, notes, and snippets.

@AlexKenbo
Created March 9, 2020 17:46
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 AlexKenbo/c37b77365647a7f6a33047336555a4bd to your computer and use it in GitHub Desktop.
Save AlexKenbo/c37b77365647a7f6a33047336555a4bd to your computer and use it in GitHub Desktop.
Stream length
// asynchronous data
main() async {
Duration interval = Duration(seconds: 1);
Stream<int> stream = Stream<int>.periodic(interval);
stream = stream.take(10);
print(await stream.length);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment