How to implement a frontend view of a backend countup timer in java?
<p>Trying to implement a timer for my game that I'm making. I have a backend class <code>Game</code> that has an <code>int timeElapsed()</code> method. This gives me elapsed time since the start in milliseconds. I also have a front end view that needs an update of this elapsed time. What is the best way to synchronize these two values? I could set up a daemon to call <code>game.timeElapsed()</code> every second, but it seems that there must be a better way to do this.</p>

<p>Another idea I had was to put some timekeeping in the frontend, but this seems like a violation of separation of responsibilities.</p>

<p>The <code>Stopwatch</code> class that I'm using to keep track of time does not support callbacks.</p>

<p>Thoughts?</p>
