Advertisement
Guest User

Stopwatch.ahk

a guest
Jun 24th, 2021
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #UseHook
  2. #NoEnv
  3. #singleinstance force
  4. Process, Priority, , R
  5. timer := "0"
  6. stopped := "1"
  7.  
  8. Gui, Add, Text, x67 y22 w60 h20 vTText, %timer%0
  9. Gui, Add, Button, x2 y42 w80 h20 vPause, Start/Stop
  10. Gui, Add, Button, x82 y42 w80 h20 vReset, Reset
  11. Gui, Show, h69 w165, Stopwatch
  12. Settimer, Stopwatch, off
  13. Return
  14.  
  15. ButtonStart/Stop:
  16. if(stopped = 0)
  17. {
  18. Settimer, Stopwatch, off
  19. stopped = 1
  20. Return
  21. }
  22. Settimer, Stopwatch, 10 ;←10ミリ秒ごとに繰り返し?
  23. stopped = 0
  24. Return
  25.  
  26. Stopwatch:
  27. timer += 1
  28. if(timer > 999)
  29. timer := "0"
  30. GuiControl, , TText , %timer%0
  31. Return
  32.  
  33. ButtonReset:
  34. timer := "0"
  35. GuiControl, , TText , %timer%0
  36. Return
  37.  
  38. GuiClose:
  39. GuiEscape:
  40. ExitApp
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement