From a01b839b6728e5da3ef02997216dc3fe24cc29f7 Mon Sep 17 00:00:00 2001 From: Ali Mashtizadeh Date: Fri, 16 Jan 2015 15:16:44 -0800 Subject: [PATCH] Fix bug in KTime_GetEpochNS() --- lib/libc/time.c | 2 -- sys/kern/ktime.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/libc/time.c b/lib/libc/time.c index aa17c38..db97342 100644 --- a/lib/libc/time.c +++ b/lib/libc/time.c @@ -20,8 +20,6 @@ time(time_t *t) uint64_t nsec = OSTime(); time_t sec = nsec / 1000000000; - printf("%ld\n", nsec); - if (t) *t = sec; diff --git a/sys/kern/ktime.c b/sys/kern/ktime.c index f997c0e..41fc445 100644 --- a/sys/kern/ktime.c +++ b/sys/kern/ktime.c @@ -194,7 +194,7 @@ KTime_GetEpochNS() Spinlock_Lock(&ktimeLock); tscDiff = Time_GetTSC() - ktimeLastTSC; - epoch = ktimeLastEpoch * 1000000000 + tscDiff * 1000000000 / ticksPerSecond; + epoch = (ktimeLastEpoch * 1000000000) + (tscDiff * 1000000000 / ticksPerSecond); Spinlock_Unlock(&ktimeLock); return epoch;