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.
mitogen/tests/bench/roundtrip.py

18 lines
291 B
Python

"""
Measure latency of local RPC.
"""
import mitogen
import time
def do_nothing():
pass
@mitogen.main()
def main(router):
f = router.fork()
t0 = time.time()
for x in range(1000):
f.call(do_nothing)
print '++', int(1e6 * ((time.time() - t0) / (1.0+x))), 'usec'