Specifically talking in the context of JavaScript game development.
For example, I can use the language specific timeout mechanism:
// Timeout is not tied to game loop at all, tied to language specific timer loop
setTimeout(() => player.age += 1, 1000);
Or I can create some custom game timer
game.createFixedDelayTimer(() => player.age += 1, 1000);
// In update loop
let lastTimerCheckTime = Date.now();
function update(game) {
checkTimers(game, lastTimerCheckTime); // Fire timer if specified delay has passed.
lastTimerCheckTime = Date.now();
}
The disadvantage to approach 2 is that the checks are less granular... but maybe it's still desirable so that game behavior is deterministic?