Simple program to record duration of keypress