• james_pic@fediverser.communick.devB
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year ago

    If you’re using either of these functions to measure latency, you’re doing it wrong. You most likely want to be using time.monotonic() or time.perf_counter(), since neither will be affected by NTP updates.

    • wil19558@fediverser.communick.devOPB
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 year ago

      I’m measuring latency compared to other servers not under my control. More specifically, the time it takes me to receive a message with server-timestamped X, compared to the current time when I receive it. Using non-absolute counters like those you mention makes it impossible to compare timestamps.

      In cases where you are comparing local times, I fully agree with you!