Cache and "refresh" behavior not clear
If the cacheExpirationMs is 1 minute and minWaitTimeBetweenSyncMs is 5 minutes, what will happen when I do a getCurrentTime() at minute 3? Will the value in the cache be used even though it is expired, will a sync be forced even though it still has 2 minutes left or will it just use the local device time?
By the look of the code, even if the last update is out of date, it'll still wait for the 5 minutes to expire before starting a new sync.
The way this library works is by keeping in memory the difference between the local device time and the server time. Whenever you call getCurrentTime(), it will use this difference to return ASAP in a non blocking way, and will request a sync in the background if needed to ensure the difference is still accurate.