How to get time of a button is being held down if button is not release

getting time continuously while button is press, not after release.