time.monotonic() roll over
Marko Rauhamaa
marko at pacujo.net
Fri Dec 5 01:17:53 EST 2014
More information about the Python-list mailing list
Fri Dec 5 01:17:53 EST 2014
- Previous message (by thread): time.monotonic() roll over
- Next message (by thread): time.monotonic() roll over
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Steven D'Aprano <steve+comp.lang.python at pearwood.info>: > Unfortunately a lot of systems get that wrong. E.g. I just ran "sleep > 30" from my Linux shell, immediately paused it using Ctrl-Z, waited a > couple of minutes, and used fg to continue. It returned immediately. > > Why is this behaviour wrong? I think the #1 thing is to specify the behavior clearly. I'm not seeing that so it is impossible to say if the GNU coreutils sleep or time.sleep() does what it was designed to do. I must admit I have neglected to document that situation in some of my related designs. Also, I think what is right or wrong depends on the use case. Ideally, there are facilities to implement the desired semantics. If a program spends long periods in an induced coma (which is becoming more and more common nowadays), the whole design of the program is under quite a bit of strain. What to do with time-based statistics collection? Should periodic operations catch up with the lost time by repeating in a tight loop for a zillion times? What to do with "impossible," out-of-order event sequences? Marko
- Previous message (by thread): time.monotonic() roll over
- Next message (by thread): time.monotonic() roll over
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list