[Calendar update fixed] Reuse and dependency-inject Calendar#7
[Calendar update fixed] Reuse and dependency-inject Calendar#7SCratORS merged 1 commit intoSCratORS:mainfrom
Conversation
eaa3f69 to
af94f3d
Compare
|
Does it even make sense to cache the calendar? Using it with every "update" does not entail any load. |
|
New calendar instance was created for every frame, which is quite expensive, see Also, for every frame, Calendar instance was created twice, once for renderer, once for scene, meaning duplicate work for each frame and slightly different time between scene and renderer. |
|
Convinced |
|
if the phone is with the screen off, then all application activity stops. this means that the counter also stops working. when the background or animation changes when the screen is turned off, then after turning on the screen, those animations and backgrounds that were before the screen was turned off are played, in order for them to update, you must look at the screen for 800 "update" cycles, that is, 40 seconds, after which everything will change. But the user will not look to wait for the animation to change, he will say after 5 seconds that there is no animation change and will give a bad rating. |
|
Yes, good point, I haven't noticed your comment earlier. Noticed it just now. |
This fixes #3
This is an amended commit that fixes time update issue.
Calendar will recompute time around every 40 seconds (every 800 frames assuming 20 fps).
Why 40 and not 60 seconds were chosen is to reduce possibility of being late by one minute for events like New Year.