Value of an integer to be shown on LCD.

Each time through loop, you are checking for events. You check to see if a button was pushed, or that the required number of pulses was received. Each time an event of interest occurs, use millis() to capture the number of milliseconds since the Arduino restarted. The function returns a long int. You can subtract one time value from another to get the difference in milliseconds.