Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #29640

Improve the monotonic time documentation in compat_time.c

We discovered in #29500 (moved) that the monotonic time documentation is incomplete. Here are some improvements we could make:

  • define "monotonic" as "strictly non-decreasing, delta t >= 0"
  • explain when 0 time deltas are more likely:
    • when measuring units larger than nanoseconds (due to truncation on division)
    • on platforms with low resolution timers (because two time calls can happen faster than the resolution of the timer)
    • on Windows, where the time is not always monotonic, due to an OS bug
    • on platforms without specialised monotonic functions, during a wall clock time change
  • explain what happens when the timers overflow?

Based on: ​https://gitweb.torproject.org/tor.git/tree/src/lib/time/compat_time.c#n175 https://trac.torproject.org/projects/tor/ticket/29500#comment:11

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking