
310
• SetElapsed(seconds As Integer, milliseconds As Integer): Configures a timer to trigger once the
specified time period has elapsed. Unlike the absolute timer methods above, changes to the system clock will not
affect the period of the SetElapsed() timer.
The ifIdentity interface provides the following:
• GetIdentity() As Integer
The ifSetSetMessagePort interface provides the following:
• SetPort(a As Object)
Example: This code uses SetElapsed() to create a timer that triggers every 30 seconds.
Sub Main()
mp = CreateObject("roMessagePort")
timer = CreateObject("roTimer")
timer.SetPort(mp)
timer.SetElapsed(30, 0)
print "Start at "; Uptime(0)
timer.Start()
while true
ev = mp.WaitMessage(0)
if type(ev) = "roTimerEvent" then
print "Timer event received at "; Uptime(0)
timer.Start()
else
Comentarios a estos manuales