[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] attitude_t.mtime (Gary E. Miller)

From: Peter Liu
Subject: Re: [gpsd-dev] attitude_t.mtime (Gary E. Miller)
Date: Fri, 28 Sep 2018 12:24:38 +0000 (GMT)

On Thu, 27 Sep 2018 20:59:19 +0000 (GMT)
Peter Liu <address@hidden> wrote:

You added attitude_t.mtime in gps.h as timespec. Unless there is some
special reasons, could we use timestamp_t instead?

There has been a long term plan to move all timestamp_t to timespec.

timespec keeps time to the nanosecond.

timestamp_t is just a double.

As a comment in gps.h notes:

/* WARNING! potential loss of precision in timestamp_t
* a double is 53 significant bits.
* UNIX time to nanoSec precision is 62 significant bits
* UNIX time to nanoSec precision after 2038 is 63 bits
* timestamp_t is only microSec precision
* timestamp_t and PPS do not play well together

So all new time will be timespe. All existing timestamps will become
timespec in gpsd 3.19.

No need to fear the conversion. It is a good thing.
You are right about precision and not playing well with PPS. Doubles only have 15 significant decimal digits. There are currently 10 digits in the integer seconds. Therefore doubles are not capable to present microseconds or below.
Is this global change necessary for fix time and attitude measurement time? Their timestamps are transmitted in the popular ISO8601 to the clients. The clients will only see ms resolution anyway.  I guess that is adequate. I am all for consistency. I love to hear more about the rationale and benefits that I have missed. Thanks in advance.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]