]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-21302: Add _PyTime_AsNanoseconds() (GH-28350)
authorVictor Stinner <vstinner@python.org>
Wed, 15 Sep 2021 12:26:43 +0000 (14:26 +0200)
committerGitHub <noreply@github.com>
Wed, 15 Sep 2021 12:26:43 +0000 (14:26 +0200)
commitb49263b698993cad2b8aaddc55cdeaa678412b30
tree8425d73518fbddd840e28d8e1d072b05778104d2
parent40d2ac92f9a28a486156dafdbb613016bb1f6b98
bpo-21302: Add _PyTime_AsNanoseconds() (GH-28350)

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().
Include/cpython/pytime.h
Modules/_testcapimodule.c
Modules/timemodule.c
Python/pytime.c