2013-05-06 50 views
0

如何設置定時器如果另一個正在運行時等待對方?該文檔說,如果一個計時器想要以低線程優先級開始,它根本不會運行。定時器等待彼此

我在找的是一個帶有多個「計時器」的腳本,每個約15分鐘,每30分鐘一個45分鐘,等等。這些都是運行時間爲一分鐘的相當長的方法,或者二。他們不能同時運行,所以如果他們已經在運行,他們必須等待對方。

回答

1

使用1個15分鐘定時器,並使用一個計數器來啓動過程2和3 Groet,羅伯特

If (Mod(A_Index, 2) = 0) 
    Do Loop 2 
If (Mod(A_Index, 3) = 0) 
    Do Loop 3 
0

@TS
需要使用主題命令NoTimers parametr,例如:

; Thread, NoTimers ; uncomment/comment this line 

SetTimer, SomeLabel1, 1500 
SetTimer, SomeLabel2, 3000 
SetTimer, SomeLabel3, 4500 

Space:: 
    KeyWait, % A_ThisHotkey 
    ExitApp 

SomeLabel1: 
    MsgBox, 262144, % A_LineNumber, % A_ThisLabel, % .75 
    Return 
SomeLabel2: 
    MsgBox, 262208, % A_LineNumber, % A_ThisLabel, % .75 
    Return 
SomeLabel3: 
    MsgBox, 262192, % A_LineNumber, % A_ThisLabel, % .75 
    Return