timing.c

来自「嵌入式VxWorks开发所需典型例程源代码」· C语言 代码 · 共 27 行

C
27
字号
/***************************************************************/
/* this program is writed by wangtao *********************************/
#include "vxworks.h"
#include "timexLib.h"
#include "stdio.h"

#define ITERATIONS 200

int printit(void);

void timing() /* Function to perform the timging */
{
FUNCPTR function_ptr = printit; /* a pointer to the function "printit"  */
timex(function_ptr,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); /*timing the "print" function */

}

int printit(void)/*Function being timed */
{
int i;
for(i=0;i<ITERATIONS;i++) /* Printing the task id number and the increment variable "i" */
	printf("Hello,I am task %d and is i=%d\n",taskIdSelf(),i );
return (0);
}
/**************************************************************************/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?