gh-74953: Add _PyTime_FromMicrosecondsClamp() function (#93942)

This commit is contained in:
Victor Stinner 2022-06-17 16:11:13 +02:00 committed by GitHub
parent 1735710873
commit e444752fab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 16 deletions

View file

@ -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)
{