Closed johanzhe closed 9 years ago
An improvement that can also consider #10 for more efficient synchronized updates of different time intervals.
I don't think "the start of every second" is well defined since all clients are slightly off from each other. If use the default update of once per second, all reactive variables will update at the same time.
However, see the updates to TimeSync.serverTime
if you'd like to change the rate at which the variable updates.
Hello Mizzao!
I'd like to propose a smarter way of triggering the SyncInternals.timeTick.changed(); dependency, so that it will trigger on the start of every second, this way the update on the client's screen (say if you're showing the current time) will look more synchronized. This could be implemented by replacing the Meteor.setInterval(function() {}) method with a Meteor.setTimeout(function() {}), and letting the enclosed function trigger the next setTimeout. I would implement it myself if I only knew a bit better about how git works...
Cheers!