millis fonction

millis() does not work this way. There is no way to set it to zero. However, there is no easy way to set the clock on your wall to zero either.

Get the value of millis() when there is a change from obstacle to no obstacle.
Get the value of millis() again when there is a change from no obstacle to obstacle.
The difference of these two values will give you the number of milliseconds for the vertical jump.

What is the question?