diff --git a/src/jtk/timer.d b/src/jtk/timer.d index 14085ac..f93afd4 100644 --- a/src/jtk/timer.d +++ b/src/jtk/timer.d @@ -15,9 +15,9 @@ class Timer this(ulong delay, ulong interval, void * user) { - ulong current_time = ms_time(); - this.next = current_time + delay; - this.interval = interval; + ulong current_time = us_time(); + this.next = current_time + (delay * 1000u); + this.interval = interval * 1000u; this.user = user; timers[this] = this; } @@ -41,7 +41,7 @@ class Timer static Timer get_expired_timer() { - ulong current_time = ms_time(); + ulong current_time = us_time(); foreach (Timer timer; timers) { if (timer.next <= current_time) @@ -55,7 +55,7 @@ class Timer static ulong time_to_next_timer_expiration() { ulong rv = cast(ulong)-1; - ulong current_time = ms_time(); + ulong current_time = us_time(); foreach (Timer timer; timers) { if (timer.next <= current_time)