7 Replies Latest reply on Nov 24, 2015 3:02 PM by user_342122993

    How to calculate time took by the psoc 5 chip for the instruction

    ammarshamim_1514511

      I have been trying to use clock () function to get the time used by code i have wrote. The code is in the main before infinite for loop.

         

      eg. 

         

      volatile clock_t start1,end1,;

         

      volatile float64 c_time;

         

       start1=clock();

         

      //then my code comes here

         

      end1= clock();

         

       c_time =( float) (end1- start1)/ (float)(CLOCKS_PER_SEC);

         

       

         

      when i debug the code and looks in the variables start1 and end1, it displays same value .

         

      is there any other way by which I can try to determine the time taken by my code.