This commit is contained in:
2026-01-25 13:09:28 +01:00
parent 90618f2336
commit a830238d11
72 changed files with 4332 additions and 643 deletions
+15
View File
@@ -0,0 +1,15 @@
// retoor <retoor@molodetz.nl>
import "timer" for Timer
var called = false
Timer.immediate {
called = true
}
System.print(called) // expect: false
Timer.sleep(1)
System.print(called) // expect: true
+20
View File
@@ -0,0 +1,20 @@
// 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
+6
View File
@@ -0,0 +1,6 @@
// retoor <retoor@molodetz.nl>
import "timer" for Timer
Timer.sleep(10)
System.print("after sleep") // expect: after sleep