how to make something time sensitive??

AWOL:
Correct: ... error-free ...

Vref = 5V, Vin = 5V. Then analogRead() returns 1023.
MeasuredVoltage = analogRead()Vref/1024 = 10235/1024 = 4.9951171875
error = |Vin - MeasuredVoltage| = 0.0048828125 > 0

Not error-free -> not correct.
Q.E.D.


It was not me who started this pointless argument about "correct" divisor. I think it is quite OT now. But I hate when someone presents "truths" such way. There is little difference between 1023 and 1024 (it depends on definition of "correct"; you failed to provide a useful one). There are much more severe problems with analogRead()*Vref/const construct. Such as stability and accuracy of Vref, speed concerns with using float arithmetic and division when it is not needed etc.