代码拉取完成,页面将自动刷新
The programming example will cover the following functions:
Prerequisites
Time conversion:
VOID Example_TransformTime(VOID)
{
UINT32 ms;
UINT32 tick;
uwTick = LOS_MS2Tick(10000);//Convert 10000 ms into ticks
dprintf("tick = %d \n",tick);
uwMs= LOS_Tick2MS(100);//Convert 100 ticks into ms
dprintf("ms = %d \n",ms);
}
Time measurement and delay:
VOID Example_GetTime(VOID)
{
UINT32 cyclePerTick;
UINT64 tickCount;
cyclePerTick = LOS_CyclePerTickGet();
if(0 != cyclePerTick) {
dprintf("LOS_CyclePerTickGet = %d \n", cyclePerTick);
}
tickCount = LOS_TickCountGet();
if(0 != tickCount) {
dprintf("LOS_TickCountGet = %d \n", (UINT32)tickCount);
}
LOS_TaskDelay(200);
tickCount = LOS_TickCountGet();
if(0 != tickCount) {
dprintf("LOS_TickCountGet after delay = %d \n", (UINT32)tickCount);
}
}
The verification result is as follows:
Time conversion:
tick = 1000
ms = 1000
Time measurement and delay:
LOS_CyclePerTickGet = 495000
LOS_TickCountGet = 1
LOS_TickCountGet after delay = 201
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。