Message143364
clock_gettime.patch: add time.clock_gettime() function and time.CLOCK_xxx constants. The patch requires to rerun "autoconf".
For the documentation, I don't know the availability of this function. Is it available on Windows? CLOCK_REALTIME doc contains "Setting this clock requires appropriate privileges": this sentence might be removed if we don't expose clock_settime.
The constants are not defined if the function is not available.
timemodule.c and datetimemodule.c are no more linked to libm. I don't know why libm was used? Copy/paste failure?
On Linux, clock_gettime() requires librt. I chose to check for librt in configure.in. To get this info in setup.py, I close to use the TIMEMODULE_LIBS define (in pyconfig.h). I don't know if there is something simpler.
time.clock_gettime() returns a float. It would be nice to keep nanoseconds as an integer, but I chose a float to mimic other time functions. If we need nanosecond resolution, a new function can be added.
The unit test is very simple, but less than time.clock() test :-) |
|
Date |
User |
Action |
Args |
2011-09-02 00:26:01 | vstinner | set | recipients:
+ vstinner, belopolsky, pitrou, kristjan.jonsson, eric.araujo, michael.foord, brian.curtin, glenn, anacrolix |
2011-09-02 00:26:00 | vstinner | set | messageid: <1314923160.98.0.215533597973.issue10278@psf.upfronthosting.co.za> |
2011-09-02 00:26:00 | vstinner | link | issue10278 messages |
2011-09-02 00:25:59 | vstinner | create | |
|