Skip to content

Commit 44c178e

Browse files
author
Matthew Sackman
committed
Multiply by a long, to promote the type to a long, hence avoiding wrapping to -ve ints
1 parent 23e70df commit 44c178e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/src/com/rabbitmq/examples/MulticastMain.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public void run() {
262262
}
263263

264264
System.out.println("sending rate avg: " +
265-
(totalMsgCount * 1000 / (now - startTime)) +
265+
(totalMsgCount * 1000L / (now - startTime)) +
266266
" msg/s");
267267

268268
}
@@ -291,7 +291,7 @@ private void delay(long now)
291291
}
292292
if (elapsed > interval) {
293293
System.out.println("sending rate: " +
294-
(msgCount * 1000 / elapsed) +
294+
(msgCount * 1000L / elapsed) +
295295
" msg/s");
296296
msgCount = 0;
297297
lastStatsTime = now;
@@ -392,7 +392,7 @@ public void run() {
392392
long elapsed = now - startTime;
393393
if (elapsed > 0) {
394394
System.out.println("recving rate avg: " +
395-
(totalMsgCount * 1000 / elapsed) +
395+
(totalMsgCount * 1000L / elapsed) +
396396
" msg/s");
397397
}
398398
}

0 commit comments

Comments
 (0)