def start_service(addr, n):
s = Subscriber(addr)<EOL>s.socket.set_string_option(nanomsg.SUB, nanomsg.SUB_SUBSCRIBE, '<STR_LIT:test>')<EOL>started = time.time()<EOL>for _ in range(n):<EOL><INDENT>msg = s.socket.recv()<EOL><DEDENT>s.socket.close()<EOL>duration = time.time() - started<EOL>print('<STR_LIT>')<EOL>util.print_stats(n, duration)<EOL>return<EOL>
Start a service