提交 a27be4a3 编写于 作者: O openharmony_ci 提交者: Gitee

!128 修正LOS_CurrNanosec时间计算精度问题

Merge pull request !128 from Caoruihong/master
......@@ -65,10 +65,8 @@ LITE_OS_SEC_TEXT_MINOR VOID LOS_GetCpuCycle(UINT32 *highCnt, UINT32 *lowCnt)
LITE_OS_SEC_TEXT_MINOR UINT64 LOS_CurrNanosec(VOID)
{
DOUBLE nanos;
nanos = (DOUBLE)HalClockGetCycles() * OS_SYS_NS_PER_SECOND / g_sysClock;
return (UINT64)nanos;
UINT64 cycle = HalClockGetCycles();
return (cycle / g_sysClock) * OS_SYS_NS_PER_SECOND + (cycle % g_sysClock) * OS_SYS_NS_PER_SECOND / g_sysClock;
}
LITE_OS_SEC_TEXT_MINOR VOID LOS_Udelay(UINT32 usecs)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册