You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
428 B
Python
23 lines
428 B
Python
7 years ago
|
"""
|
||
|
Measure latency of .local() setup.
|
||
|
"""
|
||
|
|
||
|
import os
|
||
|
import socket
|
||
|
import mitogen
|
||
|
import time
|
||
|
|
||
|
|
||
|
@mitogen.main() #(log_level='DEBUG')
|
||
|
def main(router):
|
||
|
for x in xrange(1000):
|
||
|
t = time.time()
|
||
|
f = router.local()# debug=True)
|
||
|
tt = time.time()
|
||
|
print x, 1000 * (tt - t)
|
||
|
|
||
|
print f
|
||
|
print 'EEK', f.call(socket.gethostname)
|
||
|
print 'MY PID', os.getpid()
|
||
|
print 'EEKERY', f.call(os.getpid)
|