Hello!
Using the market_length (distance in meters, 1000 m = 1.609 miles) variable, you can calculate the required waiting time:
Market's Minutes since the off is equal or greater than market_length*SECS/(1609*60)
where SECS is the number of seconds to wait per each mile.