This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to determine how long your program take?

Hi, guys! I got a problem.
I had written a program in C51, but i don't know to calculate the time taken for this whole program. Is there any way to calculate my program ?
Thank you!!!

Parents
  • Unless you've somehow managed to write the entire program without the use of any conditional statements, the time it takes to "run" will be different each time - depending on which routes it takes through all the conditions.

    Therefore you will need to work out some strategy to obtain a representative set of "run" timings, and take some sort of average.

    eg, see: http://www.keil.com/benchmks/tm_c51_v7_small.asp

    BTW: This question is usually meaningless in embedded systems: the software starts when the equipment is started, and keeps running until it is switched off!

Reply
  • Unless you've somehow managed to write the entire program without the use of any conditional statements, the time it takes to "run" will be different each time - depending on which routes it takes through all the conditions.

    Therefore you will need to work out some strategy to obtain a representative set of "run" timings, and take some sort of average.

    eg, see: http://www.keil.com/benchmks/tm_c51_v7_small.asp

    BTW: This question is usually meaningless in embedded systems: the software starts when the equipment is started, and keeps running until it is switched off!

Children
No data