[issue10278] add time.wallclock() method

2012-03-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 27441e0d6a75 by Victor Stinner in branch 'default': Issue #10278: Add an optional strict argument to time.steady(), False by default http://hg.python.org/cpython/rev/27441e0d6a75 -- ___ Python tracker <

[issue10278] add time.wallclock() method

2012-03-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset c11946846474 by Victor Stinner in branch 'default': Issue #10278: Drop time.monotonic() function, rename time.wallclock() to time.steady() http://hg.python.org/cpython/rev/c11946846474 -- ___ Python tra

[issue10278] add time.wallclock() method

2012-01-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset fb0f4fe8123e by Victor Stinner in branch 'default': Issue #10278: wallclock() cannot go backward, but two consecutive calls http://hg.python.org/cpython/rev/fb0f4fe8123e -- ___ Python tracker

[issue10278] add time.wallclock() method

2012-01-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8502a9236c2e by Victor Stinner in branch 'default': Issue #10278: Be more explicit in tests than wallclock() is monotonic (cannot http://hg.python.org/cpython/rev/8502a9236c2e -- ___ Python tracker

[issue10278] add time.wallclock() method

2012-01-18 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue10278] add time.wallclock() method

2012-01-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 83e8c3a6a81c by Antoine Pitrou in branch 'default': Be more lenient in test_wallclock (issue #10278). http://hg.python.org/cpython/rev/83e8c3a6a81c -- ___ Python tracker

[issue10278] add time.wallclock() method

2012-01-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: There are some issue on the Windows buildbots: == FAIL: test_wallclock (test.test_time.TimeTestCase) -- Traceback (most rec

[issue10278] add time.wallclock() method

2012-01-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1de276420470 by Victor Stinner in branch 'default': Issue #10278: fix a typo in the doc http://hg.python.org/cpython/rev/1de276420470 -- ___ Python tracker __

[issue10278] add time.wallclock() method

2012-01-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset bb10cd354e49 by Victor Stinner in branch 'default': Close #10278: Add time.wallclock() function, monotonic clock. http://hg.python.org/cpython/rev/bb10cd354e49 -- resolution: -> fixed stage: patch review -> committed/rejected status: open

[issue10278] add time.wallclock() method

2012-01-16 Thread akira
Changes by akira <4kir4...@gmail.com>: -- nosy: +akira ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue10278] add time.wallclock() method

2012-01-09 Thread Matthias Klose
Matthias Klose added the comment: then something like this is missing? diff -r ca2a35140e6a Modules/Setup.dist --- a/Modules/Setup.distMon Jan 09 06:17:39 2012 + +++ b/Modules/Setup.distMon Jan 09 15:25:05 2012 +0100 @@ -166,7 +166,7 @@ #cmath cmathmodule.c _math.c # -lm #

[issue10278] add time.wallclock() method

2012-01-08 Thread STINNER Victor
STINNER Victor added the comment: > on linux the underlying functionality is implemented in librt; the extension > doesn't check for this or links with -lrt. The changeset 35e4b7c4bafa changed configure.in to check clock_gettime(). It checks without and with librt: 7.7 +AC_CHECK_FUNCS(c

[issue10278] add time.wallclock() method

2012-01-08 Thread Matthias Klose
Matthias Klose added the comment: on linux the underlying functionality is implemented in librt; the extension doesn't check for this or links with -lrt. -- nosy: +doko ___ Python tracker

[issue10278] add time.wallclock() method

2011-11-29 Thread STINNER Victor
STINNER Victor added the comment: Version 3 of the patch: check for clock_gettime() failure. Try CLOCK_MONOTONIC_RAW, or try CLOCK_MONOTONIC, or use time.time(). -- Added file: http://bugs.python.org/file23809/wallclock-3.patch ___ Python tracker <

[issue10278] add time.wallclock() method

2011-11-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: As discussed elsewhere, there should be a fallback when clock_gettime() fails for the given clock. -- stage: committed/rejected -> patch review ___ Python tracker ___

[issue10278] add time.wallclock() method

2011-11-28 Thread STINNER Victor
STINNER Victor added the comment: wallclock-2.patch: implement wallclock() using the new clock_getime(CLOCK_MONOTONIC) function (or other, depending on the OS). I removed description on how the function is implemented from the doc. -- Added file: http://bugs.python.org/file23799/wallc

[issue10278] add time.wallclock() method

2011-11-25 Thread Michael Foord
Changes by Michael Foord : -- nosy: -michael.foord versions: +Python 3.3 -Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mail

[issue10278] add time.wallclock() method

2011-11-25 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue10278] add time.wallclock() method

2011-10-25 Thread STINNER Victor
STINNER Victor added the comment: I closed maybe this issue too quickly. My commit doesn't solve the initial issue: Python doesn't provide a portable "wallclock" function. wallclock.patch should be updated to use: - time.clock() on Windows (use QueryPerformanceCounter) - or time.clock_getti

[issue10278] add time.wallclock() method

2011-10-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 35e4b7c4bafa by Victor Stinner in branch 'default': Close #10278: Add clock_getres(), clock_gettime() and CLOCK_xxx constants to http://hg.python.org/cpython/rev/35e4b7c4bafa -- nosy: +python-dev resolution: -> fixed stage: -> committed/r

[issue10278] add time.wallclock() method

2011-10-25 Thread Antoine Pitrou
Antoine Pitrou added the comment: CLOCK_MONOTONIC, CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID are optional according to POSIX, which only mandates CLOCK_REALTIME. You should mention it in the docs. You might also want to export clock_getres(): http://pubs.opengroup.org/onlinepubs/96

[issue10278] add time.wallclock() method

2011-10-25 Thread STINNER Victor
STINNER Victor added the comment: The issue #13261 has been marked as a duplicate of this issue. Copy of msg146347: - time.clock () has very poor time resolution on Linux (tested on Ubuntu 11.04). The result of call to clock () changes once per several seconds. On the other side,

[issue10278] add time.wallclock() method

2011-09-01 Thread STINNER Victor
STINNER Victor added the comment: 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 "Settin

[issue10278] add time.wallclock() method

2011-08-30 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: The problem with QueryPerformanceCounter is that it drifts. It has high resolution, but can drift far out of sync with GetTickCount64. The best solutions on windows combine the two, but that's tricky to impolement. QPC will wrap, but only after a long

[issue10278] add time.wallclock() method

2011-08-30 Thread STINNER Victor
STINNER Victor added the comment: Note: it would be very pratical if time.monotonic() has always the same unit on all platforms. clock_gettime() uses seconds (and nanoseconds), time.clock() uses also seconds. -- ___ Python tracker

[issue10278] add time.wallclock() method

2011-08-30 Thread STINNER Victor
STINNER Victor added the comment: I think that we should process in two steps: * Expose low level C functions * Write a high level reusing the best low level function depending on the OS Low level functions: * Expose clock_gettime() into the time module, with CLOCK_MONOTONIC and CLOCK_MONOTO

[issue10278] add time.wallclock() method

2011-08-23 Thread STINNER Victor
STINNER Victor added the comment: See also #12822. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue10278] add time.wallclock() method

2011-07-07 Thread Matt Joiner
Matt Joiner added the comment: What's the status of this bug? This is a very useful feature, I've had to use and add bindings to monotonic times for numerous applications. Can it make it into 3.3? -- ___ Python tracker

[issue10278] add time.wallclock() method

2011-01-14 Thread Brian Curtin
Brian Curtin added the comment: > In Windows, it should probably use GetTickCount64 if available, > otherwise GetTickCount with logic to handle wrapping. I think > QueryPerformanceCounter is problematic as a general-purpose timer: > depending on the hardware and Windows version, it can be offse

[issue10278] add time.wallclock() method

2011-01-14 Thread Matt Joiner
Matt Joiner added the comment: This is sorely needed. IMO the current behaviour of time.clock works for Windows, and clock_gettime(CLOCK_MONOTONIC) on POSIX or clock_gettime(CLOCK_MONOTONIC_RAW) on Linux>=2.6.28. There are some related discussions on StackOverflow that may contain useful ide

[issue10278] add time.wallclock() method

2011-01-13 Thread Glenn Maynard
Glenn Maynard added the comment: I agree with Victor: Python should provide a function to supply monotonic time, which is what's really wanted for measuring time deltas. Far too many applications incorrectly use the system clock for this, and Python makes this worse by not providing any stan

[issue10278] add time.wallclock() method

2010-11-01 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Well, that is sort of what I'm trying to achieve. Note that you probably want to use QueryPerformaceCounter on windows (or simply time.clock()) or at least GetTickCount64 which doesn't wrap around after 50 days :). Also, I'm trying to get the highes

[issue10278] add time.wallclock() method

2010-11-01 Thread STINNER Victor
STINNER Victor added the comment: I would also be nice to have a "monotonic" clock in Python. See monotonic.py for an example. But I don't know if it solves the same problem than time.wallclock() or not. I need a monotonic clock for a server on which NTP is sometimes called to resynchronize t

[issue10278] add time.wallclock() method

2010-11-01 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: 2010/11/1 Kristján Valur Jónsson : .. > I put in the patch since it was quick to do, but I'll provoke a discussion > on python-ideas for now. I am looking forward to it. You may find reviewing the following issues helpful for your case: #9079, #2736, and

[issue10278] add time.wallclock() method

2010-11-01 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Certainly. I was going to put this simple code in time.py when I realized that time was a C module. The main point, as Antoine points out, is that time.clock() means two seriously different things on the two main platforms, and time.clock() is potenti

[issue10278] add time.wallclock() method

2010-11-01 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Nov 1, 2010 at 2:09 PM, Antoine Pitrou wrote: .. > The problem is time.clock(), since it does two wildly different things > depending on the OS. > I would suggest to deprecate time.clock() at the same time as we add > time.wallclock(). For the Uni

[issue10278] add time.wallclock() method

2010-11-01 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Nov 1, 2010 at 2:09 PM, Antoine Pitrou wrote: .. >> > Well, the problem is that the "appropriate test" is not easy to guess a >> > priori, so it would >> > be useful for the stdlib to provide the right tool for the job. >> >> This sounds like an

[issue10278] add time.wallclock() method

2010-11-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > Well, the problem is that the "appropriate test" is not easy to guess a > > priori, so it would > > be useful for the stdlib to provide the right tool for the job. > > This sounds like an argument against this feature, not for it. If it > is hard for the

[issue10278] add time.wallclock() method

2010-11-01 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Nov 1, 2010 at 1:43 PM, Antoine Pitrou wrote: .. > Well, the problem is that the "appropriate test" is not easy to guess a > priori, so it would > be useful for the stdlib to provide the right tool for the job. This sounds like an argument again

[issue10278] add time.wallclock() method

2010-11-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, the problem is that the "appropriate test" is not easy to guess a priori, so it would be useful for the stdlib to provide the right tool for the job. As for where it should live, I have no strong opinion, but it's true that the time module looks appropri

[issue10278] add time.wallclock() method

2010-11-01 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue10278] add time.wallclock() method

2010-11-01 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Why does this need to be in stdlib? AFAICT, the proposed patch is just: if : wallclock = time.clock else: wallclock = time.time which is easy enough to stick in your measuring code or a project's utilities module. If others really want to see th

[issue10278] add time.wallclock() method

2010-11-01 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +belopolsky ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue10278] add time.wallclock() method

2010-11-01 Thread Michael Foord
Michael Foord added the comment: +1 -- nosy: +michael.foord ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue10278] add time.wallclock() method

2010-11-01 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson : If measuring time across blocking calls, such as thread synchronization, one currently must time.time(). This is because time.clock() measures cpu seconds on unix. On windows, however, time.clock() would be more appropriate because it measures wal