[openstack-dev] time.sleep is affected by eventlet.monkey_patch()
黎林果
lilinguo8212 at gmail.com
Fri Mar 7 06:34:27 UTC 2014
Hi stackers,
I have do a test like:
test1.py
import time
def sleep_test():
print time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))
time.sleep(30)
print time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))
sleep_test()
test2.py
import time
import eventlet
def sleep_test():
print time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))
time.sleep(30)
print time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))
eventlet.monkey_patch()
sleep_test()
When sleeping, I modify the system time with a past time.
test1.py's resut:
2014-03-07 11:56:21
2014-03-07 11:52:17 the sleep time = 30
but the test2.py result:
2014-03-07 11:55:19
2014-03-07 *11:55:49* the sleep time = past time + 30
How can we deal the differents?
Thanks!
Lee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140307/184babcb/attachment.html>
More information about the OpenStack-dev
mailing list