Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #81916

Re: time.monotonic() roll over

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.064
X-Spam-Evidence '*H*': 0.87; '*S*': 0.00; '64-bit': 0.07; 'over,': 0.07; 'versions,': 0.07; '32-bit': 0.09; 'subject:skip:t 10': 0.09; 'cc:addr:python-list': 0.11; "wouldn't": 0.14; 'windows': 0.15; 'chatting': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'reasonably': 0.16; 'rollovers': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In- Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'scale': 0.29; 'dec': 0.30; 'newer': 0.30; 'message-id:@mail.gmail.com': 0.30; 'about.': 0.31; 'quite': 0.32; 'entirely': 0.33; 'fri,': 0.33; 'older': 0.33; 'reader': 0.33; 'could': 0.34; 'hundreds': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'ones,': 0.36; 'reflect': 0.36; 'shorter': 0.36; 'previous': 0.38; 'does': 0.39; 'sure': 0.39; 'according': 0.40; 'days': 0.60; 'even': 0.60; 'ian': 0.60; 'details.': 0.61; 'information': 0.63; 'more': 0.64; 'between': 0.67; 'believe': 0.68; 'safe': 0.72; 'lack': 0.78; 'believe,': 0.84; 'irrelevant': 0.84; 'rolls': 0.84; 'subject:over': 0.84; 'involved.': 0.91; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=J4YZwQBgXe9D4eiluBBxbRsOq6EFbTxYuWSWHfC1B/4=; b=OAWd/MBmgjzNWNyLi1539MsHU3JPcpU4LQhkfWYFG4e9bk4ZY3Oy1p0Zg52pZyGzn6 U62Lb24VlE73eQllMaIXAH7qFAC2GTzbEZ0L2+s/s7z0/iW0aYb543dGvZ8Nc3gReX4u BdOU5hUHTkG0WKzTUPR4XW6YFYnYkA7BCoY8Ll1PUtNC9plbJffZhFDiyxk0O6niA/sE 4ElxTRzA9Vblj7edU26lV5UPHGqV3CCFfY6rX2ETV5MCR26CxM97H6aJQnoZ+7hhgpQK P8Y0VOTXvmfKKBQDuuJ9eIjECf+qZSCRR9KUBcSG9SJffEhAk0iGZsXpiDgJpgebgi9U Ut0w==
MIME-Version 1.0
X-Received by 10.107.17.79 with SMTP id z76mr10169397ioi.27.1417709568584; Thu, 04 Dec 2014 08:12:48 -0800 (PST)
In-Reply-To <CALwzid=kWqOGc-BUFW66Jrg_YC706o1ucvdfnckVS=RJ7RvdbQ@mail.gmail.com>
References <54807cfd$0$2311$426a74cc@news.free.fr> <87vblr8lcw.fsf@elektro.pacujo.net> <CALwzid=kWqOGc-BUFW66Jrg_YC706o1ucvdfnckVS=RJ7RvdbQ@mail.gmail.com>
Date Fri, 5 Dec 2014 03:12:48 +1100
Subject Re: time.monotonic() roll over
From Chris Angelico <rosuav@gmail.com>
Cc Python <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.16565.1417709577.18130.python-list@python.org> (permalink)
Lines 28
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1417709577 news.xs4all.nl 2839 [2001:888:2000:d::a6]:44058
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:81916

Show key headers only | View raw


On Fri, Dec 5, 2014 at 3:05 AM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
> On Dec 4, 2014 8:56 AM, "Marko Rauhamaa" <marko@pacujo.net> wrote:
>>
>> "ast" <nomail@invalid.com>:
>>
>> > Does any body know when time.monotonic() rolls over ?
>>
>> Never, according to the documentation you linked.
>>
>> Admittedly, the documentation confuses the reader by chatting about some
>> irrelevant internal Windows details.
>
> Not entirely irrelevant. The implication is that if you go more than 49 days
> without calling the function on old Windows systems, rollovers could be
> missed, which is good to know about. The result would still be monotonic,
> but it wouldn't accurately reflect the time elapsed.

I don't know for sure about the newer Windowses, but I believe they
use a 64-bit counter instead of the 32-bit one used in previous
versions, so even if they do roll over, there'll be a much MUCH longer
time scale involved. Even if it stores time in nanoseconds, a 64-bit
counter would allow for hundreds of years between rollovers, which is
reasonably safe - much better than the month-and-a-bit of older ones,
which is shorter than quite a lot of my programs' uptimes. Hence the
lack of information about them; you don't have to worry. (Likewise on
Unix-derived systems, I believe, and for the same reason.)

ChrisA

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

time.monotonic() roll over "ast" <nomail@invalid.com> - 2014-12-04 16:25 +0100
  Re: time.monotonic() roll over Marko Rauhamaa <marko@pacujo.net> - 2014-12-04 17:50 +0200
    Re: time.monotonic() roll over Ian Kelly <ian.g.kelly@gmail.com> - 2014-12-04 09:05 -0700
      Re: time.monotonic() roll over Marko Rauhamaa <marko@pacujo.net> - 2014-12-04 18:21 +0200
        Re: time.monotonic() roll over Chris Angelico <rosuav@gmail.com> - 2014-12-05 03:27 +1100
          Re: time.monotonic() roll over Marko Rauhamaa <marko@pacujo.net> - 2014-12-04 20:09 +0200
            Re: time.monotonic() roll over Chris Angelico <rosuav@gmail.com> - 2014-12-05 05:29 +1100
              Re: time.monotonic() roll over Marko Rauhamaa <marko@pacujo.net> - 2014-12-04 20:44 +0200
                Re: time.monotonic() roll over Chris Angelico <rosuav@gmail.com> - 2014-12-05 07:02 +1100
            Re: time.monotonic() roll over Ian Kelly <ian.g.kelly@gmail.com> - 2014-12-04 12:29 -0700
            Re: time.monotonic() roll over Akira Li <4kir4.1i@gmail.com> - 2014-12-04 23:24 +0300
            Re: time.monotonic() roll over Chris Angelico <rosuav@gmail.com> - 2014-12-05 07:33 +1100
              Re: time.monotonic() roll over Marko Rauhamaa <marko@pacujo.net> - 2014-12-04 22:51 +0200
            Re: time.monotonic() roll over Ian Kelly <ian.g.kelly@gmail.com> - 2014-12-04 15:17 -0700
              Re: time.monotonic() roll over Marko Rauhamaa <marko@pacujo.net> - 2014-12-05 00:44 +0200
                Re: time.monotonic() roll over Ian Kelly <ian.g.kelly@gmail.com> - 2014-12-05 10:04 -0700
                Re: time.monotonic() roll over Marko Rauhamaa <marko@pacujo.net> - 2014-12-05 20:48 +0200
            Re: time.monotonic() roll over Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-05 11:39 +1100
              Re: time.monotonic() roll over Dave Angel <davea@davea.name> - 2014-12-04 20:21 -0500
                Re: time.monotonic() roll over Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-05 13:54 +1100
                Re: time.monotonic() roll over Dave Angel <davea@davea.name> - 2014-12-05 00:29 -0500
                Re: time.monotonic() roll over Lele Gaifax <lele@metapensiero.it> - 2014-12-05 08:56 +0100
                Re: time.monotonic() roll over Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-05 21:09 +1100
                Re: time.monotonic() roll over Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-12-05 12:12 -0500
              Re: time.monotonic() roll over Marko Rauhamaa <marko@pacujo.net> - 2014-12-05 08:17 +0200
                Re: time.monotonic() roll over Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-12-05 12:31 -0500
              Re: time.monotonic() roll over Akira Li <4kir4.1i@gmail.com> - 2014-12-05 12:48 +0300
    Re: time.monotonic() roll over Chris Angelico <rosuav@gmail.com> - 2014-12-05 03:12 +1100
    Re: time.monotonic() roll over random832@fastmail.us - 2014-12-04 11:51 -0500
  Re: time.monotonic() roll over Nobody <nobody@nowhere.invalid> - 2014-12-05 00:54 +0000

csiph-web