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-21302: Add _PyTime_AsNanoseconds() #28350

Merged
merged 1 commit into from
Sep 15, 2021
Merged

bpo-21302: Add _PyTime_AsNanoseconds() #28350

merged 1 commit into from
Sep 15, 2021

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Sep 15, 2021

Refactor pytime.c:

  • Add pytime_from_nanoseconds() and pytime_as_nanoseconds(),
    and use explicitly these functions
  • Add two empty lines between functions
  • PEP 7: add braces { ... }
  • C99: declare variables where they are set
  • Rename private functions to lowercase
  • Rename error_time_t_overflow() to pytime_time_t_overflow()
  • Rename win_perf_counter_frequency() to py_win_perf_counter_frequency()
  • py_get_monotonic_clock(): add an assertion to detect overflow when
    mach_absolute_time() unsigned uint64_t is casted to _PyTime_t
    (signed int64_t).

_testcapi: use _PyTime_FromNanoseconds().

https://bugs.python.org/issue21302

Refactor pytime.c:

* Add pytime_from_nanoseconds() and pytime_as_nanoseconds(),
  and use explicitly these functions
* Add two empty lines between functions
* PEP 7: add braces { ... }
* C99: declare variables where they are set
* Rename private functions to lowercase
* Rename error_time_t_overflow() to pytime_time_t_overflow()
* Rename win_perf_counter_frequency() to py_win_perf_counter_frequency()
* py_get_monotonic_clock(): add an assertion to detect overflow when
  mach_absolute_time() unsigned uint64_t is casted to _PyTime_t
  (signed int64_t).

_testcapi: use _PyTime_FromNanoseconds().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants