How can i measure time that is between button pressed and released states?