Python time sleep()方法

Python 教程 · 2019-02-03 12:26:38

描述

Python time sleep() 函数推迟调用线程的运行,可通过参数secs指秒数,表示进程挂起的时间。

语法

sleep()方法语法:

time.sleep(t)

参数

  • t -- 推迟执行的秒数。

返回值

该函数没有返回值。

实例

以下实例展示了 sleep() 函数的使用方法:

实例

#!/usr/bin/python import time print "Start : %s" % time.ctime() time.sleep( 5 ) print "End : %s" % time.ctime()

以上实例输出结果为:

Start : Tue Feb 17 10:19:18 2013
End : Tue Feb 17 10:19:23 2013

点击查看所有 Python 教程 文章: https://codercto.com/courses/l/8.html

查看所有标签

Clever Algorithms

Clever Algorithms

Jason Brownlee / lulu.com / 2012-6-15 / USD 37.99

Download : http://www.lulu.com/product/file-download/clever-algorithms-nature-inspired-programming-recipes/14696557 Read free on line:http://www.cleveralgorithms.com/nature-inspired/index.html T......一起来看看 《Clever Algorithms》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

URL 编码/解码
URL 编码/解码

URL 编码/解码

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器