mirror of
https://github.com/python/cpython.git
synced 2026-04-05 03:21:05 +00:00
gh-74953: Add _PyTime_FromMicrosecondsClamp() function (#93942)
This commit is contained in:
parent
1735710873
commit
e444752fab
3 changed files with 21 additions and 16 deletions
|
|
@ -406,6 +406,14 @@ _PyTime_FromNanoseconds(_PyTime_t ns)
|
|||
}
|
||||
|
||||
|
||||
_PyTime_t
|
||||
_PyTime_FromMicrosecondsClamp(_PyTime_t us)
|
||||
{
|
||||
_PyTime_t ns = _PyTime_Mul(us, US_TO_NS);
|
||||
return pytime_from_nanoseconds(ns);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
_PyTime_FromNanosecondsObject(_PyTime_t *tp, PyObject *obj)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue