Last active
November 23, 2018 18:31
-
-
Save jimjh/dcfe803a3b781c966b0e246cbd0cfffc to your computer and use it in GitHub Desktop.
gevent_sleep.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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