I use an estimate and it's pretty accurate for Flat and errors on the cautious side for jumps as they run a little longer than flat over the same distance.
market length / 100 * 6 works out to more or less the race time.
work out elapsed time.
elapsed time / race time gives a fraction of completed race so far.
This works out fine for me as I don't do anything after 0.25 distance for now.
((now_time - event_off) * mf_second)/(market_length/100 * 6)
Retyped above from memory, there might be errors .. please check and test.
beware .. place markets don't have market_length.