804 Star 2.4K Fork 1.2K

GVPHuawei LiteOS / LiteOS

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
sample_time.c 806 Bytes
一键复制 编辑 原始数据 按行查看 历史
tinyfrog 提交于 2020-12-26 19:18 . update doc info
#include "los_sys.h"
#include "los_task.h"
VOID Example_TransformTime(VOID)
{
UINT32 ms;
UINT32 tick;
tick = LOS_MS2Tick(10000); // 10000msתΪtick
dprintf("tick = %d \n",tick);
ms = LOS_Tick2MS(100); // 100tickתΪms
dprintf("ms = %d \n",ms);
}
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);
}
}
C
1
https://gitee.com/LiteOS/LiteOS.git
git@gitee.com:LiteOS/LiteOS.git
LiteOS
LiteOS
LiteOS
master

搜索帮助