[#1246] Correctly convert to nanos

This commit is contained in:
Norman Maurer 2013-04-08 10:42:54 +02:00
parent d34daebeca
commit 51de21f250

View File

@ -196,8 +196,8 @@ public class HashedWheelTimer implements Timer {
wheel = createWheel(ticksPerWheel);
mask = wheel.length - 1;
// Convert tickDuration to milliseconds.
this.tickDuration = tickDuration = unit.toMillis(tickDuration);
// Convert tickDuration to nanos.
this.tickDuration = tickDuration = unit.toNanos(tickDuration);
// Prevent overflow.
if (tickDuration == Long.MAX_VALUE || tickDuration >= Long.MAX_VALUE / wheel.length) {