Which won't work, but let's put that aside for a bit.
Yeah, clear. So here's what you do:
- Detect when the button is pressed. If so, save the time (use millis()).
- Ignore additional releases/presses for, let's say, 25 milliseconds or so (debounce)
- Detect when button is released. Subtract previously recorded time from current millis(). This gives you the time between press and release in milliseconds.
- Again ignore additional presses/releases for 25 milliseconds (debounce)
Easy peasy. What's holding you back from writing a sketch and giving it a try?
The reason we're going back and forth a bit here is that you keep restating what you want to do. We all know what you want to do. The reason you're stuck is because you're not starting with your project. Get going already!