2005年09月07日 星期三 07:45
def loop(): for i in xrange(100000): for x in xrange(10): a=[] a[:]=i,x time loop() #windowsXP CPU times: user 1.80 s, sys: 0.00 s, total: 1.80 s Wall time: 1.80 time loop() #colinux CPU times: user 0.00 s, sys: 1.44 s, total: 1.44 s Wall time: 1.44 time t=2**10000000 #windowsXP CPU times: user 1.25 s, sys: 0.00 s, total: 1.25 s Wall time: 1.25 time t=2**10000000 #colinux CPU times: user 0.53 s, sys: 0.33 s, total: 0.86 s Wall time: 0.86 time sum(xrange(10**6)) #windowsXP CPU times: user 0.41 s, sys: 0.00 s, total: 0.41 s Wall time: 0.41 time sum(xrange(10**6)) #colinux CPU times: user 0.00 s, sys: 0.48 s, total: 0.48 s Wall time: 0.48 python在linux下优化得好些吗? 为什么windows的sys一直为0.00呢? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20050907/f609543e/attachment.htm
2005年09月07日 星期三 23:27
time函数是哪里的? On 9/7/05, panhudie <nirvana117 at gmail.com> wrote: > > def loop(): > for i in xrange(100000): > for x in xrange(10): > a=[] > a[:]=i,x > time loop() #windowsXP > CPU times: user 1.80 s, sys: 0.00 s, total: 1.80 s > Wall time: 1.80 > time loop() #colinux > CPU times: user 0.00 s, sys: 1.44 s, total: 1.44 s > Wall time: 1.44 > time t=2**10000000 #windowsXP > CPU times: user 1.25 s, sys: 0.00 s, total: 1.25 s > Wall time: 1.25 > time t=2**10000000 #colinux > CPU times: user 0.53 s, sys: 0.33 s, total: 0.86 s > Wall time: 0.86 > time sum(xrange(10**6)) #windowsXP > CPU times: user 0.41 s, sys: 0.00 s, total: 0.41 s > Wall time: 0.41 > time sum(xrange(10**6)) #colinux > CPU times: user 0.00 s, sys: 0.48 s, total: 0.48 s > Wall time: 0.48 > python在linux下优化得好些吗? > 为什么windows的sys一直为0.00呢? > > _______________________________________________ > python-chinese list > python-chinese at lists.python.cn > http://python.cn/mailman/listinfo/python-chinese > > > -- Yours, fluke fluke at sfcube.net http://sfcube.net/blog -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20050907/dc3f2acf/attachment-0001.htm
2005年09月08日 星期四 00:18
ipython里面自带的 *ipython*.scipy.org/ ---------- Forwarded message ---------- > From: Fluke <fluke.l at gmail.com> > Date: Sep 7, 2005 11:27 PM > Subject: Re: [python-chinese] 在coLinux下运行python为什么有时比直接在windows下运行都快?? > To: python-chinese at lists.python.cn > > time函数是哪里的? > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20050908/642e1e30/attachment.html
2005年09月09日 星期五 00:44
在普通python里面如何计时,有什么时间函数? On 9/8/05, panhudie <nirvana117 at gmail.com> wrote: > > ipython里面自带的 > *ipython*.scipy.org/ > > ---------- Forwarded message ---------- > > From: Fluke <fluke.l at gmail.com> > > Date: Sep 7, 2005 11:27 PM > > Subject: Re: [python-chinese] 在coLinux下运行python为什么有时比直接在windows下运行都快?? > > To: python-chinese at lists.python.cn > > > > time函数是哪里的? > > > > > _______________________________________________ > python-chinese list > python-chinese at lists.python.cn > http://python.cn/mailman/listinfo/python-chinese > > > -- Yours, fluke fluke at sfcube.net http://sfcube.net/blog -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20050909/f373407e/attachment.htm
2005年09月09日 星期五 03:08
In [32]: timeit.Timer?? Type: classobj String Form: timeit.Timer Namespace: Interactive File: f:\python24\lib\timeit.py Source: class Timer: """Class for timing execution speed of small code snippets. The constructor takes a statement to be timed, an additional statement used for setup, and a timer function. Both statements default to 'pass'; the timer function is platform-dependent (see module doc string). To measure the execution time of the first statement, use the timeit() method. The repeat() method is a convenience to call timeit() multiple times and return a list of results. The statements may contain newlines, as long as they don't contain multi-line string literals. """ def __init__(self, stmt="pass", setup="pass", timer=default_timer): On 9/9/05, Fluke <fluke.l at gmail.com> wrote: > > 在普通python里面如何计时,有什么时间函数? > > On 9/8/05, panhudie <nirvana117 at gmail.com> wrote: > > > ipython里面自带的 > > *ipython*.scipy.org/ > > > > ---------- Forwarded message ---------- > > > From: Fluke <fluke.l at gmail.com> > > > Date: Sep 7, 2005 11:27 PM > > > Subject: Re: [python-chinese] 在coLinux下运行python为什么有时比直接在windows下运行都快?? > > > > > > To: python-chinese at lists.python.cn > > > > > > time函数是哪里的? > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20050909/bd15f307/attachment-0001.html
Zeuux © 2025
京ICP备05028076号