Close #10278: Add clock_getres(), clock_gettime() and CLOCK_xxx constants to

the time module. time.clock_gettime(time.CLOCK_MONOTONIC) provides a monotonic
clock
This commit is contained in:
Victor Stinner 2011-10-25 13:06:09 +02:00
parent 92b958420e
commit e0be423297
9 changed files with 615 additions and 288 deletions

View file

@ -504,11 +504,17 @@ class PyBuildExt(build_ext):
exts.append( Extension('math', ['mathmodule.c', '_math.c'],
depends=['_math.h'],
libraries=math_libs) )
# time libraries: librt may be needed for clock_gettime()
time_libs = []
lib = sysconfig.get_config_var('TIMEMODULE_LIB')
if lib:
time_libs.append(lib)
# time operations and variables
exts.append( Extension('time', ['timemodule.c', '_time.c'],
libraries=math_libs) )
exts.append( Extension('_datetime', ['_datetimemodule.c', '_time.c'],
libraries=math_libs) )
libraries=time_libs) )
exts.append( Extension('_datetime', ['_datetimemodule.c', '_time.c']) )
# random number generator implemented in C
exts.append( Extension("_random", ["_randommodule.c"]) )
# bisect