[Python-Dev] [RFC] PEP 418: Add monotonic time, performance counter and process time functions

Victor Stinner victor.stinner at gmail.com
Sat Apr 28 22:32:54 CEST 2012


>> As a thin wrapper, adding it to the time module was pretty much
>> uncontroversial, I think. The PEP proposes cross-platform
>> functions with consistent semantics, which is where a discussion was
>> needed.
>
> True, but does this mean clock_gettime and friends only exist on
> POSIX? Shouldn't they be in the os or posix module then? I guess I'm
> fine with either place but I don't know if enough thought was put into
> the decision. Up until now the time module had only cross-platform
> functions (even if clock()'s semantics vary widely).

The os module is big enough. Low level networks functions are not in
the os module, but in the socket module.

Not all functions of the time module are always available. For
example, time.tzset() is not available on all platforms. Another
example, the new time.monotonic() is not available on all platforms
;-)

Oh, I forgot to mention that time.clock_*() functions are not always
available in the doc.

Victor


More information about the Python-Dev mailing list