|
|
@ -5,6 +5,12 @@ Measure latency of .fork() setup/teardown.
|
|
|
|
import mitogen
|
|
|
|
import mitogen
|
|
|
|
import mitogen.core
|
|
|
|
import mitogen.core
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
xrange
|
|
|
|
|
|
|
|
except NameError:
|
|
|
|
|
|
|
|
xrange = range
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@mitogen.main()
|
|
|
|
@mitogen.main()
|
|
|
|
def main(router):
|
|
|
|
def main(router):
|
|
|
|
t0 = mitogen.core.now()
|
|
|
|
t0 = mitogen.core.now()
|
|
|
@ -12,4 +18,4 @@ def main(router):
|
|
|
|
t = mitogen.core.now()
|
|
|
|
t = mitogen.core.now()
|
|
|
|
ctx = router.fork()
|
|
|
|
ctx = router.fork()
|
|
|
|
ctx.shutdown(wait=True)
|
|
|
|
ctx.shutdown(wait=True)
|
|
|
|
print '++', 1000 * ((mitogen.core.now() - t0) / (1.0+x))
|
|
|
|
print('++ %d' % 1000 * ((mitogen.core.now() - t0) / (1.0+x)))
|
|
|
|