Note that below I made the time calculation take into account the tick rate, and kept this running at the fastest tick rate.