time.h    clock()

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

time.h    clock()

1,738 次查看
dlf
Contributor I

Hi.

 

Is  possible to use the function clock() of time.h library on the simulator of DSC 5600E?

 

Currently, I am treating to use it, but errors as shown belown apear.

 

undefined identifier clok_t

function Fclock has no prototype

 

It is realy urgent.

 

Many thanks.

 

 

 

#include <time.h>
#include <stdio.h>

clock_t clock(void);

int main()
{
   clock_t start, end;

 

start = clock();

//,,,,my code //

end = clock( );


elapsed = end - start;
printf("Elapsed time: %Lu \n", elapsed);

 

 }   

标签 (1)
标记 (1)
0 项奖励
回复
1 回复

493 次查看
J2MEJediMaster
Specialist I

1) Check the doucmentation to see if this function is supported by the libraries. According to the MSL C manual that describes the clock() function, it also mentions that some MSL implementations might not support this feature.

 

2) You may be linking in the wrong library, or failing to link the library that has this function.

 

3) I am not sure why you're decalreing a function prototype for clock in your code. The header file should handle that.

 

---Tom

0 项奖励
回复