Tweaked the simulation loop to support state dumps and real-time delays.