Calculating excecution time

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi all,

   

Is there a way to calculate the execution time of a routine or part of a program (between two breakpoints)? Such as a stopwatch or so?

   

I hope anyone can help!

   

Rob

0 Likes
4 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

A simple way is use a scope, and flip a pin at start and end of code segment

   

of interest. Or use a counter with a know period, and read it at start then again

   

at stop of code segment, and subtract the two readings.

   

 

   

Or you can look at .lst file and count code cycles, tedious.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Thanks Dana,

   

Then I will use the scope method. 

   

In MPLAB (PIC IDE) there is a stopwatch available, very easy to use.  Maybe an idea for Creator....?

   

Thanks!

   

Rob

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Not too difficult to program one, Just a timer, a clock and an interrupt...

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Your always welcome !

   

 

   

Dana.

0 Likes