If the call is not await
ed, execution continues:
By default the delay period is before running the supplied function, but it can also be after:
Or both:
Compared to ‘sleep’
Flow.delay is very similar to sleep
, but lets you schedule running a function after the sleep.
So instead of writing:
You can write:
sleep
is particularly elegant when you have multiple sleeps between code: