libcyphal icon indicating copy to clipboard operation
libcyphal copied to clipboard

UTC is a misnomer

Open pavel-kirienko opened this issue 6 years ago • 9 comments

There are two types of clock in libuavcan:

  • Monotonic clock, which only goes forward steadily at the same rate (with possible minor rate deviations caused by the instability of the base oscillator), and never leaps.
  • Synchronized clock, which can leap and change rate in order to keep the local time base synchronized with external sources.

Now, the current naming convention is as follows: the monotonic clock is called "monotonic", as one would expect, but the synchronized clock is called "UTC". I guess my mind was in a serous disarray when I came up with that naming; we have to do something about that.

I suggest replacing "UTC" with "Synchronized", and keep "UTC" as a deprecated alias for a while.

pavel-kirienko avatar Nov 01 '18 18:11 pavel-kirienko

I don't have a strong opinion on this, but as a point of data, POSIX uses "Monotonic" and "Realtime" to describe those two types of clocks: https://linux.die.net/man/3/clock_gettime

antoinealb avatar Nov 01 '18 18:11 antoinealb

Realtime may be misleading. The rust stdlib uses "SystemTime" for this type of clock, I think that conveys more information and is less confusing than "Syncrhonized"

kjetilkjeka avatar Nov 02 '18 10:11 kjetilkjeka

I think SystemTime is pretty good indeed.

antoinealb avatar Nov 02 '18 11:11 antoinealb

"SystemTime" [...] conveys more information and is less confusing than "Syncrhonized"

I would argue the direct opposite of that. System time is far too generic, could mean anything, including the monotonic time (remember this is not a local OS we're talking about, but a protocol). If we fail to agree on this, how about saying "Wall time"? This term is used in ROS.

pavel-kirienko avatar Nov 02 '18 12:11 pavel-kirienko

"Synctonic" will be lol) I will suggest "FlexibleTime" or maybe "AutoTime" (that means that clocks sets the rate automatically depending on conditions) or "Live Time" (that also hints to flexibility)

SergeyF1987 avatar Nov 02 '18 20:11 SergeyF1987

After some extra consideration I ended up agreeing with Kjetil that System Time might be an acceptable option. It is used in the same sense in other sources, including standard libraries of C++ or Wolfram Mathematica. It should also be acceptable to extend the notion of "system" from just the local machine running a UAVCAN node to the entirety of the bus.

Unless there are objections, let's choose Monotonic and System.

pavel-kirienko avatar Nov 03 '18 13:11 pavel-kirienko

It should also be acceptable to extend the notion of "system" from just the local machine running a UAVCAN node to the entirety of the bus.

Actually that makes me realize, why not call them Monotonic and NetworkTime (or BusTime). That being said, I am OK with System.

antoinealb avatar Nov 03 '18 14:11 antoinealb

Do we want to fix this in v0 as well @pavel-kirienko ?

thirtytwobits avatar May 29 '19 17:05 thirtytwobits

I don't think we should do that.

pavel-kirienko avatar May 29 '19 17:05 pavel-kirienko