All Samples(49441) | Call(46229) | Derive(0) | Import(3212)
time() -> floating point number Return the current time in seconds since the Epoch. Fractions of a second may be present if the system clock provides them.
src/p/y/pypy3-HEAD/pypy/interpreter/pyparser/test/unittest_samples.py pypy3(Download)
raise AssertionError('Found difference at %s : %s != %s' %
(curpos, name(elt1), name(elt2) ), curpos)
from time import time, clock
def test_samples( samples ):
time_reports = {}
for sample in samples:
print "testing", sample
tstart1, cstart1 = time(), clock()
pypy_tuples = pypy_parse(sample)
tstart2, cstart2 = time(), clock()
python_tuples = python_parse(sample)
time_reports[sample] = (time() - tstart2, tstart2-tstart1, clock() - cstart2, cstart2-cstart1 )
src/p/y/pypy-HEAD/pypy/interpreter/pyparser/test/unittest_samples.py pypy(Download)
raise AssertionError('Found difference at %s : %s != %s' %
(curpos, name(elt1), name(elt2) ), curpos)
from time import time, clock
def test_samples( samples ):
time_reports = {}
for sample in samples:
print "testing", sample
tstart1, cstart1 = time(), clock()
pypy_tuples = pypy_parse(sample)
tstart2, cstart2 = time(), clock()
python_tuples = python_parse(sample)
time_reports[sample] = (time() - tstart2, tstart2-tstart1, clock() - cstart2, cstart2-cstart1 )
src/c/h/chimera-python-0.1/docs/examples/dome/dometest.py chimera-python(Download)
dome.slewToAz (0)
print "done"
start_time = time.time()
print "="*50
print "Starting %s test at (%s)" % (name, time.strftime ("%c", time.localtime(start_time)))
print "="*50
for az in azs:
print "Moving to %s:" % az
sys.stdout.flush()
t0 = time.time()
if not dome.slewToAz(az):
print dome.getError ()
dt = time.time () - t0
dt -= 0.1 # to correct sleep time in slew
assert dome.getAz() in (az-1, az, az+1)
print " slew time: %.3f" % dt
print "done\n"
sys.stdout.flush()
finish = time.time()
def close():
print "closing the slit:"
sys.stdout.flush()
t0 = time.time ()
if not dome.slitClose ():
print dome.getError ()
dt = time.time () - t0
def open ():
print "opening the slit:"
sys.stdout.flush()
t0 = time.time ()
if not dome.slitOpen ():
print dome.getError ()
dt = time.time () - t0
src/c/h/chimera-python-0.1/docs/examples/meade/meadetest.py chimera-python(Download)
if not m.setLong("-45 34 57"):
print m.getError ()
if not m.setDate(time.time ()):
print m.getError ()
if not m.setLocalTime(time.time ()):
print "moving to East at %s rate:" % m.getSlewRates()[rate],
sys.stdout.flush()
t = time.time ()
if not m.moveEast (3, rate):
print m.getError ()
print time.time () - t
sys.stdout.flush()
print "moving to West at %s rate:" % m.getSlewRates()[rate],
sys.stdout.flush()
t = time.time ()
if not m.moveWest (3, rate):
print m.getError ()
print time.time () - t
sys.stdout.flush()
print "moving to North at %s rate:" % m.getSlewRates()[rate],
sys.stdout.flush()
t = time.time ()
if not m.moveNorth (3, rate):
print m.getError ()
print time.time () - t
print "moving to South at %s rate:" % m.getSlewRates()[rate],
sys.stdout.flush()
t = time.time ()
if not m.moveSouth (3, rate):
print m.getError ()
print time.time () - t
m.stopTracking()
start = time.time ()
finish = start + 30
print "waiting",
sys.stdout.flush ()
while time.time() < finish:
print
start = time.time ()
finish = start + (30*60) # wait 30 minutes
print "Waiting ",
while time.time() < finish:
src/q/u/querychinesesto-HEAD/prog/gbk-encode-example.py querychinesesto(Download)
print 'structÀàÐÍ', type(time.strptime('2008-02-06', '%Y-%m-%d'))
print 'utc: ', time.gmtime(), 'local: ', time.localtime()
print time.clock()
print time.time(), time.mktime(time.localtime()), time.time() == time.mktime(time.localtime())
from datetime import datetime
value = '2009-01-05'
src/o/m/omniorb-HEAD/omniORBpy/examples/tests/pclient.py omniorb(Download)
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op0(i)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op1(s)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op2(s)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op3(l)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op4(l)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op5(l)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op6(l)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op7(l)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op8(l)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op7(u)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op8(u)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op9(l)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.opa(l)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op9(d)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.opa(d)
i = i - 1
a = time.time()
src/s/c/scipy-HEAD/scipy/weave/examples/binary_search.py scipy(Download)
def search_compare(a,n):
print 'Binary search for %d items in %d length list of integers:'%(n,m)
t1 = time.time()
for i in range(n):
py_int_search(a,i)
t2 = time.time()
py = (t2-t1)
print ' speed in python:', (t2 - t1)
# bisect
t1 = time.time()
for i in range(n):
bisect(a,i)
t2 = time.time()
# get it in cache
c_int_search(a,i)
t1 = time.time()
for i in range(n):
c_int_search(a,i,chk=1)
t2 = time.time()
sp = (t2-t1)+1e-20 # protect against div by zero
print ' speed in c:',sp
print ' speed up: %3.2f' % (py/sp)
# get it in cache
c_int_search(a,i)
t1 = time.time()
t1 = time.time()
for i in range(n):
c_int_search(a,i,chk=0)
t2 = time.time()
sp = (t2-t1)+1e-20 # protect against div by zero
print ' speed in c(no asserts):',sp
print ' speed up: %3.2f' % (py/sp)
# get it in cache
c_int_search_scxx(a,i)
t1 = time.time()
for i in range(n):
c_int_search_scxx(a,i,chk=1)
t2 = time.time()
# get it in cache
c_int_search_scxx(a,i)
t1 = time.time()
for i in range(n):
c_int_search_scxx(a,i,chk=0)
t2 = time.time()
try:
a = array(a)
c_array_int_search(a,i)
t1 = time.time()
for i in range(n):
c_array_int_search(a,i)
t2 = time.time()
src/o/m/omniorbpy-HEAD/examples/tests/pclient.py omniorbpy(Download)
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op0(i)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op1(s)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op2(s)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op3(l)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op4(l)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op5(l)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op6(l)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op7(l)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op8(l)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op7(u)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op8(u)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op9(l)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.opa(l)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.op9(d)
i = i - 1
a = time.time()
sys.stdout.flush()
i = cycles
b = time.time()
while (i):
r = io.opa(d)
i = i - 1
a = time.time()
src/s/l/Slipy-Tractograhpy-HEAD/weave-local/examples/binary_search.py Slipy-Tractograhpy(Download)
def search_compare(a,n):
print 'Binary search for %d items in %d length list of integers:'%(n,m)
t1 = time.time()
for i in range(n):
py_int_search(a,i)
t2 = time.time()
py = (t2-t1)
print ' speed in python:', (t2 - t1)
# bisect
t1 = time.time()
for i in range(n):
bisect(a,i)
t2 = time.time()
# get it in cache
c_int_search(a,i)
t1 = time.time()
for i in range(n):
c_int_search(a,i,chk=1)
t2 = time.time()
sp = (t2-t1)+1e-20 # protect against div by zero
print ' speed in c:',sp
print ' speed up: %3.2f' % (py/sp)
# get it in cache
c_int_search(a,i)
t1 = time.time()
t1 = time.time()
for i in range(n):
c_int_search(a,i,chk=0)
t2 = time.time()
sp = (t2-t1)+1e-20 # protect against div by zero
print ' speed in c(no asserts):',sp
print ' speed up: %3.2f' % (py/sp)
# get it in cache
c_int_search_scxx(a,i)
t1 = time.time()
for i in range(n):
c_int_search_scxx(a,i,chk=1)
t2 = time.time()
# get it in cache
c_int_search_scxx(a,i)
t1 = time.time()
for i in range(n):
c_int_search_scxx(a,i,chk=0)
t2 = time.time()
try:
a = array(a)
c_array_int_search(a,i)
t1 = time.time()
for i in range(n):
c_array_int_search(a,i)
t2 = time.time()
src/s/c/scipy-HEAD/scipy/weave/examples/vq.py scipy(Download)
scipy.cluster.vq
print 'vq with %d observation, %d features and %d codes for %d iterations' % \
(Nobs,Nfeatures,Ncodes,m)
t1 = time.time()
for i in range(m):
code,dist = scipy.cluster.vq.py_vq(obs,codes)
t2 = time.time()
py = (t2-t1)
print ' speed in python:', (t2 - t1)/m
print code[:2],dist[:2]
t1 = time.time()
t1 = time.time()
for i in range(m):
code,dist = scipy.cluster.vq.vq(obs,codes)
t2 = time.time()
print ' speed in standard c:', (t2 - t1)/m
print code[:2],dist[:2]
print ' speed up: %3.2f' % (py/(t2-t1))
# load into cache
b = vq(obs,codes)
t1 = time.time()
for i in range(m):
code,dist = vq(obs,codes)
t2 = time.time()
# load into cache
b = vq2(obs,codes)
t1 = time.time()
for i in range(m):
code,dist = vq2(obs,codes)
t2 = time.time()
print ' speed inline/blitz2:',(t2 - t1)/ m
print code[:2],dist[:2]
print ' speed up: %3.2f' % (py/(t2-t1))
# load into cache
b = vq3(obs,codes)
t1 = time.time()
t1 = time.time()
for i in range(m):
code,dist = vq3(obs,codes)
t2 = time.time()
print ' speed using C arrays:',(t2 - t1)/ m
print code[:2],dist[:2]
print ' speed up: %3.2f' % (py/(t2-t1))
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next