📄 timing.c
字号:
#include "vxWorks.h"
#include "timexLib.h"
#include "taskLib.h"
#include "stdio.h"
#define ITERATIONS 10
static int printit(void)
{
int i;
for (i=0;i<ITERATIONS;i++)
{
logMsg("hello,I am printit(task %d) and i=%d.\n",
taskIdSelf(),i,0,0,0,0);
}
return 0;
}
void s1_time()
{
FUNCPTR function_ptr=printit;
timexN(function_ptr,0,0,0,0,0,0,0,0);
}
static void task_print(void)
{
printf("hello,I am task %d.\n",taskIdSelf());
}
void s2_tasks(void)
{
int i,taskId;
for (i=0;i<ITERATIONS;i++)
{
taskId = taskSpawn("task_print",90-i,0x100,2000,
task_print,0,0,0,0,0,0,0,0,0,0);
}
printf("\n");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -