Closed mlopezFC closed 4 years ago
This happens because currentTime
is synchronized and current-time-changed
fires on each animation frame:
https://github.com/FlowingCode/SimpleTimerAddon/blob/29689b93df4f895acb38f0d02a66919e4d3ccfa3/src/main/java/com/flowingcode/vaadin/addons/simpletimer/SimpleTimer.java#L145-L148
getCurrentTime
should be asynchronous, or at least updated on a debounced event instead of @Synchronized
Based on that, I'm thinking about two approaches that could be implemented:
Maybe it would be nice to have the possibility of disabling the listening of the events would be nice (ie: if I want to obtain current time asynchronously I would prefer not to receive requests for synchronizing the current time)
When the timer is running there are continuous requests sent to the server, a better way of dealing with this is needed.