📄 clocktest.c
字号:
#include <reworks/clock.h>
#include <ucore/error.h>
#include <stdio.h>
int clockTest()
{
OS_STATUS status;
os_tod new_time;
os_tod current_time;
unsigned32 current_ticks;
int i;
status = OSClockGet (OS_TICKS_SINCE_BOOT_GET,¤t_ticks);
if (status != OS_OK)
{
printf("OSClockGet error:[%s]\n",serrno(errno));
return -1;
}
else
printf("the ticks since boot is %d\n",current_ticks);
printf("OSClockTick 100 times\n");
for (i = 0;i<100;i++)
OSClockTick ();
status = OSClockGet (OS_TICKS_SINCE_BOOT_GET,¤t_ticks);
if (status != OS_OK)
{
printf("OSClockGet error:[%s]\n",serrno(errno));
return -1;
}
else
printf("now the ticks since boot is %d\n",current_ticks);
return 1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -