mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
gh-110850: Cleanup PyTime API: PyTime_t are nanoseconds (#115753)
PyTime_t no longer uses an arbitrary unit, it's always a number of nanoseconds (64-bit signed integer). * Rename _PyTime_FromNanosecondsObject() to _PyTime_FromLong(). * Rename _PyTime_AsNanosecondsObject() to _PyTime_AsLong(). * Remove pytime_from_nanoseconds(). * Remove pytime_as_nanoseconds(). * Remove _PyTime_FromNanoseconds().
This commit is contained in:
parent
69ab93082d
commit
e4c34f04a1
8 changed files with 57 additions and 100 deletions
|
|
@ -77,7 +77,7 @@ EnterNonRecursiveMutex(PNRMUTEX mutex, DWORD milliseconds)
|
|||
}
|
||||
} else if (milliseconds != 0) {
|
||||
/* wait at least until the deadline */
|
||||
PyTime_t nanoseconds = _PyTime_FromNanoseconds((PyTime_t)milliseconds * 1000000);
|
||||
PyTime_t nanoseconds = (PyTime_t)milliseconds * (1000 * 1000);
|
||||
PyTime_t deadline = _PyTime_Add(_PyTime_PerfCounterUnchecked(), nanoseconds);
|
||||
while (mutex->locked) {
|
||||
PyTime_t microseconds = _PyTime_AsMicroseconds(nanoseconds,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue