[Python-Dev] [RFC] PEP 418: Add monotonic time, performance counter and process time functions
Antoine Pitrou
solipsis at pitrou.net
Sat Apr 28 16:51:01 CEST 2012
On Sat, 28 Apr 2012 07:02:13 -0700
Guido van Rossum <guido at python.org> wrote:
> >
> > It is this function:
> > http://docs.python.org/dev/library/time.html#time.clock_gettime
> >
> > It's just a binding of the C function clock_gettime(). Should the PEP
> > describe all functions used by the PEP?
>
> Oh, now I'm confused. Se in 3.3 we're adding a bunch of other new
> functions to the time module that aren't described by the PEP? Aren't
> those functions redundant? Or did I miss some part of the conversation
> where this was discussed? What's *their* history?
time.clock_gettime() (and the related constants
CLOCK_{REALTIME,MONOTONIC, etc.}) is a thin wrapper around the
corresponding POSIX function, it's there for people who want low-level
control over their choice of APIs:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_gettime.html
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.
Regards
Antoine.
More information about the Python-Dev
mailing list