Jump to content

Updating elapsed time efficiently


scunliffe
 Share

Recommended Posts

In the puzzle game I'm working on I'd like to maintain an elapsed time clock shown to the user indicating how long they have been working on a particular puzzle.

e.g. 00:13:45 (thirteen minutes and fourty-five seconds)

I have no issues with the math to display the time, nor the APIs to render the text... my question is how to do this effectively?

e.g. I currently wired this up to run in my main update() loop however this therefore tries to run as frequently as it can but I only need it to run once per 1,000ms or in 1 frame (if running at 60fps)

Is there an API to only call something a "max" of once per "time period"?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...