So i have this little app, what i want to do is: when i click start it will start a timer, and so on for different progressbars
however I am not sure why the time will sometimes stop for 1-2 sec then continue
another problem i am having is clicking multiple timers will tend to lag the previous timers, is there a better way to go about this?
#include <Array.au3>
#include <ProgressConstants.au3>
#include <GUIConstantsEx.au3>
$Form1_1 = GUICreate("Form1", 450, 150)
Dim $Progress[7]
$Progress[1] = GUICtrlCreateProgress(80, 10, 150, 16, $PBS_SMOOTH )
$Progress[2] = GUICtrlCreateProgress(80, 30, 150, 16, $PBS_SMOOTH )
$Progress[3] = GUICtrlCreateProgress(80, 50, 150, 16, $PBS_SMOOTH )
$Progress[4] = GUICtrlCreateProgress(80, 70, 150, 16, $PBS_SMOOTH )
$Progress[5] = GUICtrlCreateProgress(80, 90, 150, 16, $PBS_SMOOTH )
$Progress[6] = GUICtrlCreateProgress(80, 110, 150, 16, $PBS_SMOOTH )
Dim $Label[7]
$Label[1] = GUICtrlCreateInput("", 8, 10, 60, 17)
$Label[2] = GUICtrlCreateInput("", 8, 30, 60, 17)
$Label[3] = GUICtrlCreateInput("", 8, 50, 60, 17)
$Label[4] = GUICtrlCreateInput("", 8, 70, 60, 17)
$Label[5] = GUICtrlCreateInput("", 8, 90, 60, 17)
$Label[6] = GUICtrlCreateInput("", 8, 110, 60, 17)
Dim $Button[7]
$Button[1] = GUICtrlCreateButton("Start", 240, 10, 50, 17)
$Button[2] = GUICtrlCreateButton("Start", 240, 30, 50, 17)
$Button[3] = GUICtrlCreateButton("Start", 240, 50, 50, 17)
$Button[4] = GUICtrlCreateButton("Start", 240, 70, 50, 17)
$Button[5] = GUICtrlCreateButton("Start", 240, 90, 50, 17)
$Button[6] = GUICtrlCreateButton("Start", 240, 110, 50, 17)
Dim $Num[7]
$Duration = 10
GUISetState(@SW_SHOW)
$Check = False
While 1
$msg = GUIGetMsg()
$Add = 0
If $msg = $GUI_EVENT_CLOSE Then Exit
For $a = 1 to UBound($Progress)-1
If $msg = $Button[$a] Then
GUICtrlSetData($Progress[$a], 100)
$Num[$a] = 100
$Change = TimerInit()
EndIf
Next
If $Check = True Then $Change1 = TimerDiff($Change)
For $a = 1 to UBound($Progress)-1
If GUICtrlRead($Progress[$a]) > 0 Then
Sleep(1)
$New = $Num[$a] - (($Change1/1000)/$Duration)*100
GUICtrlSetData($Progress[$a], $New)
$Num[$a] = $New
ConsoleWrite($Num[$a]&@LF)
EndIf
$Check = True
Next
$Change = TimerInit()
WEnd