// retoor <retoor@molodetz.nl>
|
|
|
|
import "timer" for Timer, TimerHandle
|
|
|
|
var count = 0
|
|
var handle = Timer.interval(1) {
|
|
count = count + 1
|
|
}
|
|
|
|
System.print(handle is TimerHandle) // expect: true
|
|
System.print(handle.isActive) // expect: true
|
|
|
|
Timer.sleep(100)
|
|
handle.stop()
|
|
|
|
System.print(count > 0) // expect: true
|
|
System.print(handle.isActive) // expect: false
|
|
|
|
|
|
System.print(count) // nontest
|