Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Oct 13, 2017

Return time as an integer number of nanoseconds since epoch.

https://bugs.python.org/issue31784

@vstinner vstinner changed the title bpo-31784: Add time.time_ns() [WIP] bpo-31784: Add time.time_ns() Oct 16, 2017
@vstinner vstinner changed the title [WIP] bpo-31784: Add time.time_ns() [WIP] bpo-31784: Implement PEP 564: add time.time_ns() Nov 1, 2017
@vstinner vstinner changed the title [WIP] bpo-31784: Implement PEP 564: add time.time_ns() bpo-31784: Implement PEP 564: add time.time_ns() Nov 2, 2017
Add new time functions:

* time.clock_gettime_ns()
* time.clock_settime_ns()
* time.monotonic_ns()
* time.perf_counter_ns()
* time.process_time_ns()
* time.time_ns()

Add new _PyTime functions:

* _PyTime_FromTimespec()
* _PyTime_FromNanosecondsObject()
* _PyTime_FromTimeval()

Other changes:

* Add also os.times() tests to test_os.
* pytime_fromtimeval() and pytime_fromtimeval() now return
  _PyTime_MAX or _PyTime_MIN on overflow, rather than undefined
  behaviour
* _PyTime_FromNanoseconds() parameter type changes from long long to
  _PyTime_t
@vstinner vstinner merged commit c29b585 into python:master Nov 2, 2017
@vstinner vstinner deleted the time_ns branch November 2, 2017 14:28
embray pushed a commit to embray/cpython that referenced this pull request Nov 9, 2017
Add new time functions:

* time.clock_gettime_ns()
* time.clock_settime_ns()
* time.monotonic_ns()
* time.perf_counter_ns()
* time.process_time_ns()
* time.time_ns()

Add new _PyTime functions:

* _PyTime_FromTimespec()
* _PyTime_FromNanosecondsObject()
* _PyTime_FromTimeval()

Other changes:

* Add also os.times() tests to test_os.
* pytime_fromtimeval() and pytime_fromtimeval() now return
  _PyTime_MAX or _PyTime_MIN on overflow, rather than undefined
  behaviour
* _PyTime_FromNanoseconds() parameter type changes from long long to
  _PyTime_t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants