The Counting Gate Keeper Related as it requires you to measure the time between the first and last input. But here you're required to count how many inputs in a period of time.

I was assigned a task to stand by a gate and count how many students enter it. The problem is that my memory is not as good as it was when I first started this job. I need some kind of program to help me count how many students enter the gate until my shift is over.
Task
Given an integer t that represents the number of seconds until my shift is over. Tell me how many times I pressed the button during that time.
Rules

The button press can be any convenient user input, such as pressing the Return key;
You can assume that t will allways be in range [1; 60];
You can assume that the number of students will be less than 231;
When the time is up, you must output within 1 second;
Your program does not need to end, as long as the only output to stdout is at the end of the shift;
If your input method (such as Enter-key) repeats if held, you can choose to count it just once, or several times. Either way, you must still be able to handle separate inputs.
TI-Basic, 22 bytes
Fairly simple. Sets a time Ans seconds in the future which we call T which is when the loop stops. While the loop is going, we check for if a key is pressed. It's been a while since I had the fgitw :)
startTmr+Ans-&gt;T
0
While T≠startTmr
Ans+not(not(getKey
End