00:40 msgbox, Min 00: Sec 40
01:50 msgbox, Min 01: Sec 50
I know it's simple, but I've been trying without success.
![Sad :(](./images/smilies/icon_e_sad.gif)
Code: Select all
q:: ;Start, Pause, Continue
IF Stop =
{
Start := A_TickCount
SetTimer, Clock, 100
Stop = 0
Gui, Font, s40, Verdana
Gui, Add, Text, vStopWatch, Min 00: Sec 00
Gui, Submit, NoHide
Gui, Show,,
}
Else IF Stop := !Stop
Start -= A_TickCount
Else
Start += A_TickCount
Return
Clock:
Clock = 20000101000000
Clock += (A_TickCount-Start)//1000, Seconds
IF (Clock = OldClock) Or Stop
Return
FormatTime, Clock,% OldClock := Clock, mm:ss
GuiControl,, StopWatch,% "Min " SubStr(Clock,1,3) " Sec " SubStr(Clock,4)
Return
OMG!Isn't there something simpler? I don't want a GUI, please, something simpler.Rohwedder wrote: ↑11 Sep 2021, 12:18Hallo,
yes, it's simple.
I have a gui version here. From this you can make a version with msgbox:Code: Select all
q:: ;Start, Pause, Continue IF Stop = { Start := A_TickCount SetTimer, Clock, 100 Stop = 0 Gui, Font, s40, Verdana Gui, Add, Text, vStopWatch, Min 00: Sec 00 Gui, Submit, NoHide Gui, Show,, } Else IF Stop := !Stop Start -= A_TickCount Else Start += A_TickCount Return Clock: Clock = 20000101000000 Clock += (A_TickCount-Start)//1000, Seconds IF (Clock = OldClock) Or Stop Return FormatTime, Clock,% OldClock := Clock, mm:ss GuiControl,, StopWatch,% "Min " SubStr(Clock,1,3) " Sec " SubStr(Clock,4) Return
Code: Select all
#Persistent
Input, key, VL1, % "{LControl}{RControl}{LAlt}{RAlt}{LShift}{RShift}{LWin}{RWin}{AppsKey}"
. "{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{Left}{Right}{Up}{Down}{Home}{End}"
. "{PgUp}{PgDn}{Del}{Ins}{BS}{CapsLock}{NumLock}{PrintScreen}{Pause}"
start := A_TickCount
SetTimer, Box, 1000
Box:
dif := A_TickCount - start, min := dif // 60000
MsgBox,, Elapsed, % Format("Min {:02}: Sec {:02}", min, Round((dif - 60000 * min) / 1000)), 0.9
Return