Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-31784: Implement PEP 564: add time.time_ns() #3989

Merged
merged 1 commit into from Nov 2, 2017
Merged

bpo-31784: Implement PEP 564: add time.time_ns() #3989

merged 1 commit into from Nov 2, 2017

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.

None yet

3 participants