Hope you having good weekend. Some chilling and some coding Maybe some one could help met to find what I missing and do not see, because I do not understand why I do not get wanted time format.
To speed just change → Settimer, Stopwatch, 1000 to 100.
I want to display always format 02:01:15, but for some reason I do not understand why I get always 2:1:15, and then seconds get to max point, its reseting to 000?
Code: Select all
#SingleInstance, Force
;Source: https://autohotkey.com/board/topic/88714-simple-stop-watch/
timerh := "00"
timerm := "00"
timers := "00"
stopped := "0"
Gui, Add, Button, x2 y42 w80 h20 vPause, Pause
Gui, Add, Button, x82 y42 w80 h20 vReset, Reset
Gui, Add, Text, x67 y22 w60 h20 BackgroundTrans E0x20 vTText, %timerh%:%timerm%:%timers%
Gui, Show, h69 w165, Stopwatch
Settimer, Stopwatch, 1000
Return
Stopwatch:
timers += 1
if(timers > 59) ; 59
{
timerm += 1
timers := "00"
GuiControl, , TText , %timerh%:%timerm%:%timers%
}
if(timerm > 59) ;59
{
timerh += 1
timerm := "00"
timers := "00"
GuiControl, , TText , %timerh%:%timerm%:%timers%
}
if(timers < 10)
{
GuiControl, , TText , %timerh%:%timerm%:0%timers%
}
else
{
GuiControl, , TText , %timerh%:%timerm%:%timers%
}
return
ButtonPause:
if(stopped = 0)
{
Settimer, Stopwatch, off
stopped = 1
}
else
{
Settimer, Stopwatch, 999
stopped = 0
}
return
ButtonReset:
timerh := "00"
timerm := "00"
timers := "00"
GuiControl, , TText , %timerh%:%timerm%:%timers%
return
GuiClose:
GuiEscape:
ExitApp
^!x::
TrayTip, %A_ScriptName% is closed, `n, 5, 17 ; `n makes empty, 5 means 5 sec, 17 type of icon 18 19 20
/*
SetTimer, HideTrayTip, -2000
HideTrayTip() {
TrayTip
}
*/
ExitApp