How does a simulation keep track of time?

By keeping a record of every time it has reached, newest first.

Time is probably the most important variable to track in a simulation. This is because everything that happens within a simulation only has meaning with respect to the real world if we can trace what point in simulated time that it happened.

Time is a variable in the simulation which always increases in value. We often want to track how it increases after each discrete simulation ‘step’ in increments which we shall call ‘timesteps’.

The data structure that does this is a ‘cumulative timesteps history’, which indexes simulated times that the simulation had according to decreasing recency.

References and further reading

Hardwick, Robert J. 2026. “Why should I simulate the real world?” umbralcalculations, May. https://umbralcalc.github.io/posts/why_should_i_simulate_the_real_world.html.
Law, Averill M., and W. David Kelton. 2014. Simulation Modeling and Analysis. 5th ed. McGraw-Hill.