i am stuck and darn stuck i am trying to make a kunar lander like this in c++

Play LunarLander Game

in this program i am stuck at the fireing rocket stage

i need a function that tell me the duration i have pressed a key


e.g
i press "A" or any key it gives me the time from when i press A and leave it in millisecond