Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I don't see why you need to compare time in this specific problem. You have to look for "key down" events. That means when the user pressed the button not while it is pressed or released. In Unity you achieve this with GetKeyDown. This way your code will no longer start running multiple times but only when both conditions are satisfied (key down and both key pressed at that time).