Hi, I wanted to know what ways there are to find out how long a section of code will take to run. I have an EEPROM connected and can store that time value in it to access later on. Is there a command that can store the time delayed between two points? What means have all of you used to see how long your code takes to execute some portion?
Jon
NikkiC
Joined: 21 Jun 2004 Posts: 3 Location: London, UK
Posted: Fri Jan 07, 2005 5:25 pm
Three ways: using an oscilloscope, using the simulator in MPLAB or simply counting the number of clock cycles required to execute any chunk of code.
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
Posted: Sat Jan 08, 2005 10:49 pm
Set up a timer interrupt. Count the interrupts in the ISR. Sample the counter before and after the code of interest executes (assumption: code of interest is not inside another ISR). Calculate the difference of the counter and store it in the EEPROM.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum