For example, the former code with thread: ``` clas...
# coroutines
s
For example, the former code with thread:
Copy code
class MyRunner(val n: Int) {
    fun run() {
        doSomething()
        Thread.sleep(1000)
    }
}

fun main(args: Array<String>) {
    (1..100).forEach { n ->
        thread { 
            MyRunner(n).run()
        }
    }
}