Monkey
Store
Community
Apps
Contact
Login or Signup

Millisecs() strategy

Monkey Programming Forums/Monkey Programming/Millisecs() strategy

muddy_shoes(Posted 1+ years ago) 
I just have global time values that I set once per update loop. Each update/render is a frozen point in time so there's no value in continually getting the "real" time during those time slices. In fact doing so could cause synchronisation problems as time gets smeared across your game update.

Note that when I say "once per update loop" I mean whatever update loops you have in your game that need time information, not necessarily the mojo update loop. For example, my current project maintains separate concepts of user time and game world time so there's one time value for each but neither are updated more than once per pass through the relevant loop.