Fix bug in KTime_GetEpochNS()
This commit is contained in:
parent
2342aefe9e
commit
a01b839b67
@ -20,8 +20,6 @@ time(time_t *t)
|
|||||||
uint64_t nsec = OSTime();
|
uint64_t nsec = OSTime();
|
||||||
time_t sec = nsec / 1000000000;
|
time_t sec = nsec / 1000000000;
|
||||||
|
|
||||||
printf("%ld\n", nsec);
|
|
||||||
|
|
||||||
if (t)
|
if (t)
|
||||||
*t = sec;
|
*t = sec;
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ KTime_GetEpochNS()
|
|||||||
|
|
||||||
Spinlock_Lock(&ktimeLock);
|
Spinlock_Lock(&ktimeLock);
|
||||||
tscDiff = Time_GetTSC() - ktimeLastTSC;
|
tscDiff = Time_GetTSC() - ktimeLastTSC;
|
||||||
epoch = ktimeLastEpoch * 1000000000 + tscDiff * 1000000000 / ticksPerSecond;
|
epoch = (ktimeLastEpoch * 1000000000) + (tscDiff * 1000000000 / ticksPerSecond);
|
||||||
Spinlock_Unlock(&ktimeLock);
|
Spinlock_Unlock(&ktimeLock);
|
||||||
|
|
||||||
return epoch;
|
return epoch;
|
||||||
|
Loading…
Reference in New Issue
Block a user