sleep(t): 该方法可以把当前执行进程挂起t个时间。time可是浮点数,t的单位为second.
Example:
#!/usr/bin/python
import time
print "Start : %s" % time.ctime()
time.sleep( 5 )
print "End : %s" % time.ctime()
import time
print "Start : %s" % time.ctime()
time.sleep( 5 )
print "End : %s" % time.ctime()
结果:
Start : Wed May 2 23:14:34 2012
End : Wed May 2 23:14:39 2012
本文介绍Python中的sleep方法,该方法可以将当前进程挂起指定的时间。通过一个简单的例子展示了如何使用sleep方法来延迟程序执行。
5206

被折叠的 条评论
为什么被折叠?



