How to get button press duration?

Okay, so, I think it’s just a thing of setting a timer with OnPressed event and stopping it with OnRelase, right? But… How to do it?