Add a method that will only ever return NTP synced time, or null.
We currently have two options for getting time:
getCurrentTimeMs() always returns a time as a Long. It falls back to the local clock if no ntp sync has occurred.
getCurrentTime() always returns a time as a KronosTime. The KronosTime.posixTimeMs is equal to the value of getCurrentTimeMs(). You can discover whether we fell back to the fallback clock by checking timeSinceLastNtpSyncMs == null. This works, but seems unnecessarily complicated.
Add a method that will only ever return NTP synced time, or null.
We currently have two options for getting time:
getCurrentTimeMs()
always returns a time as aLong
. It falls back to the local clock if no ntp sync has occurred.getCurrentTime()
always returns a time as aKronosTime
. TheKronosTime.posixTimeMs
is equal to the value ofgetCurrentTimeMs()
. You can discover whether we fell back to the fallback clock by checkingtimeSinceLastNtpSyncMs == null
. This works, but seems unnecessarily complicated.