[code:2bb1jypp]+ MouseKeyboard: Key Space is down
+ System: Is global variable 'Timestamp' Equal to 0
-> System: Set global variable 'Timestamp' to Timer
+ System: Else
-> System: Set global variable 'Duration' to Timer - global('Timestamp')
+ MouseKeyboard: On key Space released
-> System: Set global variable 'Timestamp' to 0
-> System: Set global variable 'Duration' to 0
+ System: Always (every tick)
-> EditBox: Set text to global('Timestamp') & " : " & global('Duration')[/code:2bb1jypp]
Copied as text from Construct, the above is probably how I'd do it. The indented lines are sub-events. The Editbox was just a simple way to display the variables in real time.
Depending upon your needs, you may not need two variables. The above will need the timestamp to be stored, at least.
You could also use a variation that adds TimeDelta to a duration variable every tick while the key is down, and sets it to zero when released...