• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(37647)  |  Call(10)  |  Derive(0)  |  Import(37637)
This module provides various functions to manipulate time values.

There are two standard representations of time.  One is the number
of seconds since the Epoch, in UTC (a.k.a. GMT).  It may be an integer
or a floating point number (to represent fractions of seconds).
The Epoch is system-defined; on Unix, it is generally January 1st, 1970.
The actual value can be retrieved by calling gmtime(0).

The other representation is a tuple of 9 integers giving local time.
The tuple items are:
  year (four digits, e.g. 1998)
  month (1-12)
  day (1-31)
  hours (0-23)
  minutes (0-59)
  seconds (0-59)
  weekday (0-6, Monday is 0)
  Julian day (day in the year, 1-366)
  DST (Daylight Savings Time) flag (-1, 0 or 1)
If the DST flag is 0, the time is given in the regular time zone;
if it is 1, the time is given in the DST time zone;
if it is -1, mktime() should guess based on the date and time.

Variables:

timezone -- difference in seconds between UTC and local standard time
altzone -- difference in  seconds between UTC and local DST time
daylight -- whether local time should reflect DST
tzname -- tuple of (standard time zone name, DST time zone name)

Functions:

time() -- return current time in seconds since the Epoch as a float
clock() -- return CPU time since process start as a float
sleep() -- delay for a number of seconds given as a float
gmtime() -- convert seconds since Epoch to UTC tuple
localtime() -- convert seconds since Epoch to local time tuple
asctime() -- convert time tuple to string
ctime() -- convert time in seconds to string
mktime() -- convert local time tuple to seconds since Epoch
strftime() -- convert time tuple to string according to format specification
strptime() -- parse string to time tuple according to format specification
tzset() -- change the local timezone

src/k/a/kamaelia-HEAD/Code/Python/Axon/Examples/Handles/TestHandle.py   kamaelia(Download)
#!/usr/bin/python
 
import time
from Axon.background import background
from Kamaelia.UI.Pygame.Text import Textbox, TextDisplayer
from Axon.Handle import Handle
background().start()

src/k/a/kamaelia-HEAD/Code/Python/Axon/Examples/Handles/reverser.py   kamaelia(Download)
#!/usr/bin/env python
import time, sys, Axon
from Axon.Handle import Handle
from Axon.background import background
import Queue
background().start()
 

src/s/p/spike-HEAD/vendor/stackless/v2.5.1/Doc/lib/tzinfo-examples.py   spike(Download)
 
# A class capturing the platform's idea of local time.
 
import time as _time
 
STDOFFSET = timedelta(seconds = -_time.timezone)
if _time.daylight:

src/s/p/spike-HEAD/vendor/stackless/current/Doc/lib/tzinfo-examples.py   spike(Download)
 
# A class capturing the platform's idea of local time.
 
import time as _time
 
STDOFFSET = timedelta(seconds = -_time.timezone)
if _time.daylight:

src/s/p/spike-HEAD/vendor/Python/v2.5.1/Doc/lib/tzinfo-examples.py   spike(Download)
 
# A class capturing the platform's idea of local time.
 
import time as _time
 
STDOFFSET = timedelta(seconds = -_time.timezone)
if _time.daylight:

src/s/p/spike-HEAD/vendor/Python/current/Doc/lib/tzinfo-examples.py   spike(Download)
 
# A class capturing the platform's idea of local time.
 
import time as _time
 
STDOFFSET = timedelta(seconds = -_time.timezone)
if _time.daylight:

src/l/a/Langtangen-HEAD/src/py/examples/simviz/simviz1_ssh_pexpect.py   Langtangen(Download)
child.sendline(password)
child.expect(pexpect.EOF)  # important; wait for end of scp session
 
import time; time.sleep(2) # sleep to make scp finish
if not os.path.isfile('sim.dat'):
    print 'no result file sim.dat - script aborted...'
 
    print 'running gnuplot failed'; sys.exit(1)
 
# clean up:
import time; time.sleep(3)  # let Gnuplot have some time for plotting...
for file in ('run_%s.py' % case, '%s.i' % case, 'sim.dat'):
    print 'removing', file;  os.remove(file)
 

src/l/a/Langtangen-HEAD/src/py/examples/pde/wave1D_func5.py   Langtangen(Download)
    This routine assumes that ODESolver is used to solve the ODEs
    u_tt=F, where F is a class WaveRHS. (Should be parameter to this func!!!)
    """
    import time
    t0 = time.clock()
 
    dx = L/float(n)
    else:
        g = None
 
    import time
    t0 = time.clock()
    solutions, x, dt, cpu = visualizer(I, f, c, U_0, U_L, L,
    n, 0, tstop, user_action=None, version=version, graphics=g)

src/l/a/Langtangen-HEAD/src/py/examples/pde/wave1D_func4.py   Langtangen(Download)
    can add visualization, error computations, data analysis,
    store solutions, etc.
    """
    import time
    t0 = time.clock()
 
    dx = L/float(n)
    else:
        g = None
 
    import time
    t0 = time.clock()
    solutions, x, dt, cpu = visualizer(I, f, c, U_0, U_L, L,
    n, 0, tstop, user_action=None, version=version, graphics=g)

src/l/a/Langtangen-HEAD/src/py/examples/pde/wave1D_func3.py   Langtangen(Download)
    can add visualization, error computations, data analysis,
    store solutions, etc.
    """
    import time
    t0 = time.clock()
 
    g = UniformBoxGrid(x=(0,L), nx=n)
    else:
        g = None
 
    import time
    t0 = time.clock()
    solutions, x, dt, cpu = visualizer(I, f, c, U_0, U_L, L,
    n, 0, tstop, user_action=None, version=version, graphics=g)

Previous  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13  Next