Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.025 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'received:internal': 0.09; 'subject:skip:t 10': 0.09; 'discusses': 0.16; 'guarded': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:66.111.4.27': 0.16; 'received:messagingengine.com': 0.16; 'received:out3-smtp.messagingengine.com': 0.16; 'all.': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'appears': 0.22; 'code,': 0.22; 'integer': 0.24; 'looks': 0.24; 'header:In-Reply-To:1': 0.27; 'dec': 0.30; 'run': 0.32; 'received:66': 0.35; 'consistent': 0.36; 'received:10': 0.37; 'to:addr:python-list': 0.38; 'issue': 0.38; 'does': 0.39; 'realize': 0.39; 'to:addr:python.org': 0.39; 'called': 0.40; 'days': 0.60; 'from:no real name:2**0': 0.61; 'first': 0.61; 'header:Message-Id:1': 0.63; 'between': 0.67; '2014,': 0.84; 'rolls': 0.84; 'subject:over': 0.84 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.us; h= message-id:x-sasl-enc:from:to:mime-version :content-transfer-encoding:content-type:subject:date:in-reply-to :references; s=mesmtp; bh=6raWwA2iwYH/jnW+OQp6XFTPG4s=; b=K1RLJr VSUGElPhn+JA6+rR18Ci5srso/LY3YG2/3hLmJaGYmDHcbM5cYsbmeYXHro9rgds PBDONgKDU4HSwAvj3PGxYq75jLgbg/LQkaB8BD9gHjRr9wiRVwODyx0Qqbixjtrh vglM5GDP8EaWDgW/XBtEIfo7nEkb7ztmYldcI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:x-sasl-enc:from:to :mime-version:content-transfer-encoding:content-type:subject :date:in-reply-to:references; s=smtpout; bh=6raWwA2iwYH/jnW+OQp6 XFTPG4s=; b=CK7WMGhGe3MqS/z4UKkt/KUnLbNwLVDaYkVjF0+NhXO7aVI4Asdd gXE+Zjq5MMUBNRlPjIough9jGyGAG2UBtHQs3PkcpfV4A6RVVAyqefzX7x7qCFyh /qgDhrEDLQZqNKZOem8f6a0Xh/r/yGKZ1buWtMPtEFWmu2C7bQkaasY= X-Sasl-Enc: IYpEmE3EjvGFinWMQrt3n1p3KroJrULQjLe1kgO3Ux9I 1417711876 From: random832@fastmail.us To: python-list@python.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-53201334 Subject: Re: time.monotonic() roll over Date: Thu, 04 Dec 2014 11:51:16 -0500 In-Reply-To: <87vblr8lcw.fsf@elektro.pacujo.net> References: <54807cfd$0$2311$426a74cc@news.free.fr> <87vblr8lcw.fsf@elektro.pacujo.net> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1417711878 news.xs4all.nl 2893 [2001:888:2000:d::a6]:54403 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:81920 On Thu, Dec 4, 2014, at 10:50, Marko Rauhamaa wrote: > That is, the internal integer wrap is not guarded against between the > calls to time.monotonic(), maybe. Looking at the code, it looks like it does guard against the rollover, though if you let your program run for 49.7 days _without_ calling time.monotonic during that time, it will not realize that it has passed the original value multiple times. And of course, if it rolls over before the first time you call monotonic in process B, process B's value will be less than process A which called it before the rollover. This is consistent with the documentation, and appears to be the reason the documentation discusses this issue at all.