linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Helmut Grohne <helmut.grohne@intenta.de>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	"Bartosz Golaszewski" <bartekgola@gmail.com>
Subject: Re: [libgpiod] cxx bindings: time_point vs duration
Date: Thu, 15 Oct 2020 14:13:12 +0200	[thread overview]
Message-ID: <20201015121312.GA7166@laureti-dev> (raw)
In-Reply-To: <CAMRc=MdWi94uzYb6OprmVoGnfmSHUCevqAPPgXOPHQNVrj0jfQ@mail.gmail.com>

On Thu, Oct 15, 2020 at 01:43:32PM +0200, Bartosz Golaszewski wrote:
> Well, it's a long story. It used to be what the kernel calls REALTIME
> clock, then it was changed to MONOTONIC and now there's a suggestion
> to make it configurable in v2. More on that here[1].

Ouch. I was wodering already as the timestamps looked like REALTIME
here, but I'm simply using an older kernel. In that case the type of
your timestamps should depend on the Linux kernel version, which is
impossible to do. All you can do now is lie for older kernels.

> One question is: even if on linux the steady_clock is backed by
> CLOCK_MONOTONIC, is this a guarantee or just implementation? And can
> we rely on this if it's not defined?

Like the nanosecond resolution of steady_clock this is certainly not
guarantueed. However, it is rooted so deeply that it is very unlikely to
change. In theory, there could be a chance of changing it to
CLOCK_BOOTTIME. I don't think anyon is going to try.

At this point I recommend going with steady_clock.

Helmut

  reply	other threads:[~2020-10-15 12:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15  8:38 [libgpiod] cxx bindings: time_point vs duration Helmut Grohne
2020-10-15  9:26 ` Bartosz Golaszewski
2020-10-15  9:35   ` Helmut Grohne
2020-10-15 10:05     ` Bartosz Golaszewski
2020-10-15 10:57       ` Helmut Grohne
2020-10-15 11:43         ` Bartosz Golaszewski
2020-10-15 12:13           ` Helmut Grohne [this message]
2020-10-15 12:16             ` Bartosz Golaszewski
2020-10-21 13:57               ` Jack Winch
2020-10-21 14:35                 ` Jack Winch
2020-10-21 15:14                 ` Bartosz Golaszewski
2020-10-21 15:44                   ` Jack Winch
2020-10-22  6:39                 ` Helmut Grohne
2020-10-22  9:09                   ` Jack Winch
2020-10-22  9:35                     ` Bartosz Golaszewski
2020-10-22  9:47                       ` Jack Winch
2020-10-22 11:55                         ` Bartosz Golaszewski
2020-10-22 12:22                           ` Jack Winch
2020-10-23 16:22                             ` Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201015121312.GA7166@laureti-dev \
    --to=helmut.grohne@intenta.de \
    --cc=bartekgola@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=linux-gpio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).