Skip to content

Instantly share code, notes, and snippets.

@jimjh

jimjh/gevent_sleep.py

Last active Nov 23, 2018
Embed
What would you like to do?
gevent_sleep.py
"""Usage: start `nc -l 127.0.0.1 8080`, then run this script."""
from __future__ import print_function
import socket
import time
if __name__ == '__main__':
n1 = time.clock()
n2 = time.time()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('127.0.0.1', 8080))
s.recv(5)
print('time.clock: %f' % (time.clock() - n1))
print('time.time: %f' % (time.time() - n2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment