Measuring time between two events

Record the value returned by millis() at the first event.
When the second event happens subtract the above value from the current value of millis().

The difference is time in milliseconds.