time module

input/ldompeling at casema.nl input/ldompeling at casema.nl
Sun Nov 8 05:25:28 EST 2015


>  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 at 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 at ix.netcom.com    HTTP://wlfraed.home.netcom.com/




-- 
--------------------------------- --- -- -
Posted with NewsLeecher v7.0 Beta 2
Web @ http://www.newsleecher.com/?usenet
------------------- ----- ---- -- -




More information about the Python-list mailing list