Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #98435
| From | input/ldompeling@casema.nl |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: time module |
| References | <mailman.114.1446941944.16136.python-list@python.org> |
| Message-ID | <sqF%x.23626$mP1.4332@fx24.ams1> (permalink) |
| Organization | Pure Usenet - Usenet for everyone |
| Date | 2015-11-08 10:25 +0000 |
> Ambiguous requirement: any normal counter starts from zero... But what > "zero" represents may differ... Seconds since Jan 1 1970? Seconds since > midnight? Seconds since start of program? Thanks for the reply Yes, I would like seconds since start of program. Can I not doing something like time()=0 only this gives an error. Thanks ------------------------------------------------------------------------ In reply to "Dennis Lee Bieber" who wrote the following: > On Sat, 07 Nov 2015 21:27:06 GMT, input/ldompeling@casema.nl declaimed the > following: > > > hi, > > > > I like to have a function that prints time in seconds. > > I am looking for something for example that seconds count from zero. > > I search the internet for time module in python but could not found anathing > > usefull. > > > > Ambiguous requirement: any normal counter starts from zero... But what > "zero" represents may differ... Seconds since Jan 1 1970? Seconds since > midnight? Seconds since start of program? > > > > > import time > > > > t0 = time.time() > > > > t0 > 1446941608.052 > > > > t0 / 60.0 > 24115693.467533335 > > > > t0 / 60.0 / 60.0 > 401928.22445888893 > > > > t0 / 60.0 / 60.0 / 24.0 > 16747.009352453704 > > > > t0 / 60.0 / 60.0 / 24.0 / 365.25 > 45.850812737724034 > > > > > > Almost 46 years worth of seconds. > > > > > tStart = time.time() > > > > for x in range(10): > ... time.sleep(x) > ... print time.time() - tStart > ... > 36.5020000935 > 37.5040001869 > 39.5090000629 > 42.5099999905 > 46.5170001984 > 51.5190000534 > 57.5200002193 > 64.5210001469 > 72.5230000019 > 81.5230000019 > > > > > > Okay, I'm not the fastest typist (35 seconds from tStart to finishing the > loop code) > -- > Wulfraed Dennis Lee Bieber AF6VN > wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/ -- --------------------------------- --- -- - Posted with NewsLeecher v7.0 Beta 2 Web @ http://www.newsleecher.com/?usenet ------------------- ----- ---- -- -
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
time module input/ldompeling@casema.nl - 2015-11-07 21:27 +0000
Re: time module Cameron Simpson <cs@zip.com.au> - 2015-11-08 08:47 +1100
Re: time module Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-11-07 19:19 -0500
Re: time module input/ldompeling@casema.nl - 2015-11-08 10:25 +0000
Re: time module Marko Rauhamaa <marko@pacujo.net> - 2015-11-08 13:05 +0200
csiph-web