使用AutoIt,如何在时间为xx:00
,xx:15
,xx:30
和xx:45
(每15分钟)时通过识别实际时间来执行某些操作? >
答案 0 :(得分:0)
Sleep(1000 * 60 * 15)
可以使用。示例如下:
“ 通过确认实际时间”
-要求(使用Mod()
和@MIN
-macro):
Global Const $g_iInterval = 15
Global Const $g_iDelay = 10
Global Const $g_sMsg = 'Triggered at %s:%s\n'
Global $g_sLast = ''
While True
If Not (@MIN = $g_sLast) And Mod(Int(@MIN), $g_iInterval) = 0 Then
$g_sLast = @MIN
ConsoleWrite(StringFormat($g_sMsg, @HOUR, @MIN))
EndIf
Sleep($g_iDelay)
WEnd
控制台输出:
Triggered at 00:00
Triggered at 00:15
Triggered at 00:30
Triggered at 00:45
Triggered at 01:00
Triggered at 01:15
Triggered at 01:30
Triggered at 01:45
...