Permalink
Browse files

Changed around directory structure.

  • Loading branch information...
1 parent 38209a8 commit 01619fdfab1f40722e90967bcff41087a77a82b8 @steveWang steveWang committed Jul 19, 2011
Showing with 7 additions and 31 deletions.
  1. +7 −0 examples/barebones/now_barebones.js
  2. 0 { → lib}/nowclient.js
  3. +0 −31 now_barebones.js
@@ -0,0 +1,7 @@
+var nowclient = require('./nowclient.js');
+var now = nowclient.now;
+var socket = nowclient.socket;
+
+now.receiveMessage = function (message) {
+ console.log(message);
+};
File renamed without changes.
View
@@ -1,31 +0,0 @@
-var nowclient = require('./clusterclient.js');
-var now = nowclient.now;
-var socket = nowclient.socket;
-var interval;
-var total = 0, count = 0, sent = 0, startTime;
-setTimeout(function () {
- var outbound = 0, lastCount = 0;
- var a, b;
- now.receiveMessage = function (message) {
- if (count == 10000) {
- console.log(total/count);
- now.receiveMessage = function () {};
- clearInterval(a);
- clearInterval(b);
- return;
- }
- ++count;
- total += Date.now() - message;
- };
- now.start = function (interval) {
- count = 0;
- a = setInterval(function () {
- outbound++;
- now.distributeMessage(Date.now());
- }, interval);
- b = setInterval(function () {
- console.log(outbound, -lastCount + (lastCount = count));
- outbound = 0;
- }, 1000);
- };
-}, 1000);

0 comments on commit 01619fd

Please sign in to comment.