time.h    clock()

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

time.h    clock()

1,739件の閲覧回数
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 返信

494件の閲覧回数
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 件の賞賛
返信