time.h    clock()

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

time.h    clock()

1,737 Views
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);

 

 }   

Labels (1)
Tags (1)
0 Kudos
Reply
1 Reply

492 Views
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 Kudos
Reply