Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

misc

  • Loading branch information...
commit c353612e6c700ef808ac3b3419e94e4a64ab8122 1 parent 8dbbbd9
@tj tj authored
Showing with 6 additions and 6 deletions.
  1. +4 −3 benchmark/pub.js
  2. +2 −3 benchmark/sub.js
View
7 benchmark/pub.js
@@ -5,7 +5,8 @@ var zmq = require('../')
var n = 100000
, ops = n;
-pub.connect('ipc:///tmp/zmq.sock', function(){
- console.log('publishing %d messages', n);
- while (ops--) pub.send('foo');
+pub.connect('ipc:///tmp/zmq.sock');
+console.log('publishing %d messages', n);
+while (ops--) process.nextTick(function(){
+ pub.send('foo');
});
View
5 benchmark/sub.js
@@ -3,14 +3,13 @@ var zmq = require('../')
, sub = zmq.socket('sub');
var start
- , ops = 100000;
+ , ops = 100000
+ , n = ops;
sub.subscribe('');
sub.on('message', function(msg){
- console.error(msg);
--n || (function(){
var duration = new Date - start;
- pub.close();
sub.close();
console.log();
console.log(' pub/sub:');
Please sign in to comment.
Something went wrong with that request. Please try again.