Help with timestamps and values returned

I have a machine with an RTC.

For the sake of..... (something), I compare it to the software one at regular intervals.
(Say 20 seconds)

To help keep things simple with the maths (and size of numbers) I resolve it down to "Seconds past midnight.

This may have a problem when Daylight savings kicks in, but more on that later.

Usually I am not seeing much of a problem, but nowadays I have recently hooked up an LED (physical one) and when a disparity is detected the LED comes on.

Of course there is the bad side to that. It seems to come on a fair bit.

I have the drift/acceptable slip set at 60000 and that seems to keep things happy most of the time.

But this morning when I got up there was an NTP SLIP indication.

{"sw_time":966047,"rtc_time":1002016,"difference":35969,"_msgid":"1fce9e63.9c74a2","time":"2020-09-05 03:21:28","ttl":0,"_queuetimestamp":1599240098742,"_queueCount":1}

But I am needing someone to help me scale these numbers.

How much is 1002016?

How much is 60000?

Yeah probably easy questions. But I feel I have to ask.

Thanks in advance.

Further research is that it is milliseconds.

So: 60000 is 6 seconds - yes?

1002016 is about 16 minutes - yes?

Divide by 1000 (drop 3 numbers off the end)

So 60000 == 60s, 1002016 == 1002.016 sec == 16.7 min

1 Like

I just wanted to be sure.

I have had enough adventures down rabbit holes of late.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.