Skip to content

Instantly share code, notes, and snippets.

@alokomkar
Created October 21, 2022 02:42
Show Gist options
  • Select an option

  • Save alokomkar/9e9e409b1242230162bb0a58ea11e0a0 to your computer and use it in GitHub Desktop.

Select an option

Save alokomkar/9e9e409b1242230162bb0a58ea11e0a0 to your computer and use it in GitHub Desktop.
Light weight coroutines
import kotlinx.coroutines.*
fun main() = runBlocking {
repeat(100_000) { // launch a lot of coroutines
launch {
delay(5000L)
print(".")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment