Code: Select all
~Space:: ; Triggered when the Space key is pressed
StartTime := A_TickCount ; Record the start time
KeyWait, Space ; Wait for the Space key to be released
ElapsedTime := A_TickCount - StartTime ; Calculate the elapsed time
MsgBox, Time elapsed: %ElapsedTime% milliseconds
return
What must be done so that the time is recorded when I press the controller key that is linked to "space"
[Mod action: Moved topic to the v1 section since this is v1 code. The main section is now for v2.]