Skip to content

Instantly share code, notes, and snippets.

Last active January 18, 2023 05:42
What would you like to do?
Use launch to create coroutines in Kotlin. Full article:
// Use launch to create coroutines
import kotlinx.coroutines.*
fun main() {
// Start a coroutine using the launch function
val job = GlobalScope.launch {
// Perform a long-running task in the background
println("Hello, world!")
// Wait for the coroutine to finish
runBlocking {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment