We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a7ad14 commit 9b30f3bCopy full SHA for 9b30f3b
src/WIP/stdCallableScheduler.bas
@@ -16,13 +16,17 @@ End Sub
16
'Call all scheduled callbacks
17
'@protected
18
Public Sub protCallScheduledCallbacks()
19
+ Dim vCurTime: vCurTime = Now()
20
+
21
Dim i As Long
22
For i = scheduledCallbacks.Count To 1 Step -1
23
Dim cb As stdICallable: Set cb = scheduledCallbacks(i)(0)
24
Dim onTime As Date: onTime = scheduledCallbacks(i)(1)
- If onTime < Now() Then
25
+ If DateDiff("s", onTime, vCurTime) >= 0 Then
26
Call scheduledCallbacks.Remove(i)
- Call cb.Run()
27
+ 'Allow the callback to reschedule itself if needed
28
+ Dim iSeconds As Long: iSeconds = cb.Run()
29
+ If iSeconds > 0 Then Call ScheduleCallback(cb, iSeconds)
30
End If
31
Next
32
End Sub
0 commit comments