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

查看所有标签

Lighttpd

Lighttpd

Andre Bogus / Packt Publishing / 2008-10 / 39.99

This is your fast guide to getting started and getting inside the Lighttpd web server. Written from a developer's perspective, this book helps you understand Lighttpd, and get it set up as securely an......一起来看看 《Lighttpd》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换