Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: time.monotonic() roll over Date: Thu, 04 Dec 2014 20:09:49 +0200 Organization: A noiseless patient Spider Lines: 29 Message-ID: <87ppbzp9qq.fsf@elektro.pacujo.net> References: <54807cfd$0$2311$426a74cc@news.free.fr> <87vblr8lcw.fsf@elektro.pacujo.net> <87r3wf8jy8.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="27427"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Y6HZA1VJzYl293WeLFXp4" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:zHD9wYwepw5YK07eVXhQQSn4Yw4= sha1:Ogrx9gk8ImHWe1tR+QOz6aXI2h0= Xref: csiph.com comp.lang.python:81928 Chris Angelico : > It's not a Python issue. Python can't do anything more than ask the > system, and if the system's value rolls over several times a year, > Python can't magically cure that. The information has already been > lost. Sure it could by having an invisible background thread occasionally call time.monotonic(). It could even be done on the side without a thread. Anyway, the idea of a clock is complicated: * the program could be stopped by a STOP signal * the program could be suspended from power management * the program could be resurrected from a virtual machine snapshot * the program could be migrated from a different physical machine So, if I call time.sleep(86400) and the program is suspended for 24 hours, should time.sleep() return right after it is resumed or after another 24 hours? Marko