Problem
Write a program where you will try to complete the code by starting a coroutine. The coroutine will keep processing three times with a delay of 0.1 seconds, and when the coroutines end, it will print the name of users with a delay of 1 second. You have to make a suspending function named getFlow
using Flow
, and this function will print the user’s count.
Restriction
The output will be available in the terminal.
Output
The output will be as follows; here, we will see a delay of 0.1 seconds before every coroutine processing statement and 1 second of delay after every user statement. After all the processing and before printing the user, there will be a delay of 0.7 seconds .
Coroutine Processing
Coroutine Processing
Coroutine Processing
User0
User1
User2
Get hands-on with 1400+ tech skills courses.