Understanding the High-Resolution Timer

All games today require at least some semblance of a timer. Back in the “early days” of game development, using a timer wasn't considered important. Computer systems were still all relatively the same speed (slow), and any calculations that needed to be performed could be based on the number of frames that had passed. If the code was only ever going to run on a single computer system, or if every system it was running on was identical, this might be a valid way to perform these calculations—but even in that case, it's not normally the best-case scenario.

Imagine the situation where you are designing a physical limit on a car. Does it make more sense to think “The maximum speed of the car is 250 units per ...

Get Beginning 3D Game Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.