A couple of PEP 418 comments

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

A couple of PEP 418 comments

Antoine Pitrou

Hello,

I'm just starting a new thread since the old ones are so crowded.
First, overall I think the PEP is starting to look really good and
insightful! (congratulations to Victor)

I have a couple of comments, mostly small ones:

> "function" (str): name of the underlying operating system function.

I think "implementation" is a better name here (more precise, and
perhaps also more accurate :-)).

> time.monotonic()
> time.perf_counter()
> time.process_time()

The descriptions should really stress the scope of the result's
validity. My guess (or wish :-)) would be:

- time.monotonic(): system-wide results, comparable from one process to
  another
- time.perf_counter(): process-wide results, comparable from one thread
  to another (?)
- time.process_time(): process-wide, by definition

It would also be nice to know if some systems may be unable to
implement time.monotonic().

> GetTickCount() has an precision of 55 ms on Windows 9x.

Do we care? :) Precision under recent Windows variants (XP or later)
would be more useful.

Is there a designated dictator for this PEP?

Regards

Antoine.


_______________________________________________
Python-Dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/lists%2B1324100855712-1801473%40n6.nabble.com
Reply | Threaded
Open this post in threaded view
|

Re: A couple of PEP 418 comments

Victor Stinner-3
> The descriptions should really stress the scope of the result's
> validity. My guess (or wish :-)) would be:
>
> - time.monotonic(): system-wide results, comparable from one process to
>  another
> - time.perf_counter(): process-wide results, comparable from one thread
>  to another (?)
> - time.process_time(): process-wide, by definition

time.monotonic() and time.perf_counter() are process-wide on Windows
older than Vista because of GetTickCount() overflow, on other OSes,
they are system-wide.

> It would also be nice to know if some systems may be unable to
> implement time.monotonic().

You can find such information in the following section:
http://www.python.org/dev/peps/pep-0418/#clock-monotonic-clock-monotonic-raw-clock-boottime

All OSes provide a monotonic clock, except GNU/Hurd. You mean that it
should be mentioned in the time.monotonic() section?

>> GetTickCount() has an precision of 55 ms on Windows 9x.
>
> Do we care? :) Precision under recent Windows variants (XP or later)
> would be more useful.

You can get the precision on Windows Seven in the following table:
http://www.python.org/dev/peps/pep-0418/#monotonic-clocks

I will move the precision of monotonic clock of Windows 9x info into this table.

Victor
_______________________________________________
Python-Dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/lists%2B1324100855712-1801473%40n6.nabble.com
Reply | Threaded
Open this post in threaded view
|

Re: A couple of PEP 418 comments

Brian Curtin
On Fri, Apr 13, 2012 at 11:29, Victor Stinner
> I will move the precision of monotonic clock of Windows 9x info into this table.

I would just remove it entirely. It's not relevant since it's not supported.
_______________________________________________
Python-Dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/lists%2B1324100855712-1801473%40n6.nabble.com
Reply | Threaded
Open this post in threaded view
|

Re: A couple of PEP 418 comments

Antoine Pitrou
In reply to this post by Victor Stinner-3
On Fri, 13 Apr 2012 18:29:10 +0200
Victor Stinner <[hidden email]> wrote:

> > The descriptions should really stress the scope of the result's
> > validity. My guess (or wish :-)) would be:
> >
> > - time.monotonic(): system-wide results, comparable from one process to
> >  another
> > - time.perf_counter(): process-wide results, comparable from one thread
> >  to another (?)
> > - time.process_time(): process-wide, by definition
>
> time.monotonic() and time.perf_counter() are process-wide on Windows
> older than Vista because of GetTickCount() overflow, on other OSes,
> they are system-wide.

Perhaps, but you should say in the PEP, not here ;-)
By the way, I wonder if it may be a problem if monotonic() is
process-wide under Windows.

> All OSes provide a monotonic clock, except GNU/Hurd. You mean that it
> should be mentioned in the time.monotonic() section?

Yes, that would be clearer.

Regards

Antoine.


_______________________________________________
Python-Dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/lists%2B1324100855712-1801473%40n6.nabble.com