Opened 3 years ago

Closed 3 years ago

#24427 closed enhancement (implemented)

Consider using other mach_*_time() functions for monotonic time on OSX

Reported by: nickm Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.3.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: ahf Sponsor: Sponsor8-can


As of OSX 10.9, there is a mach_approximate_time() which looks at first glance like it might be suitable for use as our monotime_coarse.

As of OSX 10.12, there are mach_continuous_absolute_time() and mach_continuous_approximate_time(), which are supposed to keep counting while the system is sleeping.

Child Tickets

Change History (6)

comment:1 Changed 3 years ago by nickm

Owner: set to nickm
Status: newaccepted

comment:2 Changed 3 years ago by nickm

Status: acceptedneeds_review

See branch feature24427 in my public repository. It just uses mach_approximate_time() for coarse monotonic time, to save a few cycles when we can.

comment:3 Changed 3 years ago by ahf

Reviewer: ahf

comment:4 Changed 3 years ago by ahf

Status: needs_reviewmerge_ready

Looks good. Have this been tested on a mac or would you like some testing there?

comment:5 Changed 3 years ago by nickm

I've made sure it compiles and passes basic tests on my mac. Merging!

comment:6 Changed 3 years ago by nickm

Resolution: implemented
Status: merge_readyclosed
Note: See TracTickets for help on using tickets.