?? testosclocktick.c
字號:
#include <reworks/clock.h>
#include <ucore/error.h>
#include <stdio.h>
int testOSClockTick()
{
OS_STATUS status;
os_tod new_time;
os_tod current_time;
int i;
printf("*** test of OSClockTick ***\n");
status = OSClockGet (OS_TOD_GET,¤t_time);
if (status != OS_OK)
{
printf("OSClockGet error:[%s]\n",serrno(errno));
return -1;
}
else
printf("the current time is %d.%d.%d,%d:%d:%d:%d\n",
current_time.year,
current_time.month,
current_time.day,
current_time.hour,
current_time.minute,
current_time.second,
current_time.ticks);
printf("OSClockTick 100 times\n");
for(i=0;i<100;i++)
{
OSClockTick();
}
status = OSClockGet (OS_TOD_GET,¤t_time);
if (status != OS_OK)
{
printf("OSClockGet error:[%s]\n",serrno(errno));
return -1;
}
else
printf("the time after OSClockTick 100 times is %d.%d.%d,%d:%d:%d:%d\n",
current_time.year,
current_time.month,
current_time.day,
current_time.hour,
current_time.minute,
current_time.second,
current_time.ticks);
printf("*** OSClockTick test OK! ***\n");
return 1;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -