measuring the time between two interrupts