Skip to content

Instantly share code, notes, and snippets.

@jimjh
Last active November 23, 2018 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimjh/dcfe803a3b781c966b0e246cbd0cfffc to your computer and use it in GitHub Desktop.
Save jimjh/dcfe803a3b781c966b0e246cbd0cfffc to your computer and use it in GitHub Desktop.
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