Skip to content

Instantly share code, notes, and snippets.

@progrium
Created November 29, 2010 08:42
Show Gist options
  • Select an option

  • Save progrium/719737 to your computer and use it in GitHub Desktop.

Select an option

Save progrium/719737 to your computer and use it in GitHub Desktop.
import sys
import os
import uuid
from time import time
import zmq
from zmq import devices
ctx = zmq.Context(10)
sent = 0
queue = ctx.socket(zmq.REQ)
queue.connect('ipc:///tmp/frontend-in')
n = 0
t1 = time()
for i in range(50000):
n += 1
queue.send("job-%s-%s" % ('1', n))
ok = queue.recv()
sent += 1
td = time() - t1
print td
print 1/(td/50000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment