Saltycrane logo

SaltyCrane Blog

Notes on Python, Django, and web development on Ubuntu Linux

    

python sleep

How to sleep for 5 seconds in python:

import time

time.sleep(5)

How to sleep for 0.5 seconds in python:

import time

time.sleep(0.5)

Documentation: time.sleep()

1 Comment — feed icon Comments feed for this post


#1 Alvin Mites commented on 2011-02-11:

Oddly enough I keep forgetting the syntax for this.

Post a comment

Required
Required, but not displayed
Optional

Format using Markdown. (No HTML.)
  • Code blocks: prefix each line by at least 4 spaces or 1 tab (and a blank line before and after)
  • Code span: surround with backticks
  • Blockquotes: prefix lines to be quoted with >
  • Links: <URL>
  • Links w/ description: [description](URL)
Created with Django | Hosted by Slicehost