Advertisement
Guest User

AHK timer

a guest
Jul 29th, 2014
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. StartTime := A_TickCount
  2. Gui -ToolWindow +AlwaysOnTop
  3. Gui, Font, s32, Tahoma
  4. Gui, Add, Text, w320 h48 c00FF32 vTimer +Center, 00:00:00:00.000
  5. Gui, Color, 000000
  6. Gui, Show
  7.  
  8. loop
  9. {
  10. NowTime := A_TickCount - StartTime
  11. ms := Mod(NowTime, 1000)
  12. s := Mod((NowTime-ms)/1000,60)
  13. m := Mod((((NowTime-ms)/1000)-s)/60,60)
  14. h := Mod(((((((NowTime-ms)/1000)-s)/60)-m)/60),24)
  15. d := ((((((((NowTime-ms)/1000)-s)/60)-m)/60)-h)/24)
  16. SetFormat , Float, 02.0
  17. if ms > 99
  18. {
  19.     GuiControl , Text , Timer , %d%:%h%:%m%:%s%.%ms%
  20. }
  21. else
  22. if ms > 9
  23. {
  24.     GuiControl , Text , Timer , %d%:%h%:%m%:%s%.0%ms%
  25. }
  26. else
  27. {
  28.     GuiControl , Text , Timer , %d%:%h%:%m%:%s%.00%ms%
  29. }
  30. Sleep 32
  31. IfWinNotExist , timer.ahk
  32.     Gui, Show
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement