Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75264 > unrolled thread

What's the difference between gevent.sleep and time.sleep?

Started byXiadong Zhu <mailto1587@gmail.com>
First post2014-07-26 18:38 -0700
Last post2014-07-27 03:22 -0400
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  What's the difference between gevent.sleep and time.sleep? Xiadong Zhu <mailto1587@gmail.com> - 2014-07-26 18:38 -0700
    Re:What's the difference between gevent.sleep and time.sleep? Dave Angel <davea@davea.name> - 2014-07-27 03:22 -0400

#75264 — What's the difference between gevent.sleep and time.sleep?

FromXiadong Zhu <mailto1587@gmail.com>
Date2014-07-26 18:38 -0700
SubjectWhat's the difference between gevent.sleep and time.sleep?
Message-ID<06f8b528-92e9-4979-80dd-43e0267dcf7b@googlegroups.com>
Hi, I'm learning gevent, but I didn't found the difference with gevent.sleep and time.sleep, does anybody could give me a sample code to show their difference? Thanks!

[toc] | [next] | [standalone]


#75266

FromDave Angel <davea@davea.name>
Date2014-07-27 03:22 -0400
Message-ID<mailman.12356.1406445778.18130.python-list@python.org>
In reply to#75264
Xiadong Zhu <mailto1587@gmail.com> Wrote in message:
> Hi, I'm learning gevent, but I didn't found the difference with gevent.sleep and time.sleep, does anybody could give me a sample code to show their difference? Thanks!
> 

gevent is a cooperative analog to the threading module. When using
 it you would never use time.sleep.  So no example is
 needed.

time.sleep would suspend the entire process, blocking all greenlet
 threads.

-- 
DaveA

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web