Own-Programming-Language-Tu.../examples/basics/thread.own

22 lines
237 B
Scala
Raw Normal View History

2023-09-09 15:52:32 +03:00
use std
2016-02-20 10:12:26 +02:00
def thread1() {
i = 0
while (i < 100) {
2016-06-02 17:43:55 +03:00
println "i = " + i
i++
2016-02-20 10:12:26 +02:00
sleep(100)
}
}
// thread("thread1")
thread(::thread1)
k = 0
while (k < 10) {
2016-06-02 17:43:55 +03:00
println "k = " + k
k++
2016-02-20 10:12:26 +02:00
sleep(1000)
}