mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #22117: The signal modules uses the new _PyTime_t API
* Add _PyTime_AsTimespec() * Add unit tests for _PyTime_AsTimespec()
This commit is contained in:
parent
7181dec3f1
commit
34dc0f46ae
5 changed files with 88 additions and 15 deletions
|
@ -145,6 +145,12 @@ PyAPI_FUNC(int) _PyTime_AsTimeval(_PyTime_t t,
|
|||
struct timeval *tv,
|
||||
_PyTime_round_t round);
|
||||
|
||||
#ifdef HAVE_CLOCK_GETTIME
|
||||
/* Convert a timestamp to a timespec structure (nanosecond resolution).
|
||||
Raise an exception and return -1 on error, return 0 on success. */
|
||||
PyAPI_FUNC(int) _PyTime_AsTimespec(_PyTime_t t, struct timespec *ts);
|
||||
#endif
|
||||
|
||||
/* Get the current time from the system clock.
|
||||
* Fill clock information if info is not NULL.
|
||||
* Raise an exception and return -1 on error, return 0 on success.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue