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

why is down counter more efficient than up counter

Hi!

I have a question. Why is down coutner more efficient than up counter?

In CMSDK, all of timers are with down-counter. I think there is a reason that ARM utilized down-counter except up-counter.

Parents
  • This is a common optimization, as comparing with zero is a standard operation, vs comparing against an arbitrary ceiling value.

    You will also see this in code, for example:

    for (i=0; i<MAX_VALUE; i++)...

    Is typically less efficient than:

    for(i=MAX_VALUE; i>0; i--)...

    Regards

    Ronan

Reply
  • This is a common optimization, as comparing with zero is a standard operation, vs comparing against an arbitrary ceiling value.

    You will also see this in code, for example:

    for (i=0; i<MAX_VALUE; i++)...

    Is typically less efficient than:

    for(i=MAX_VALUE; i>0; i--)...

    Regards

    Ronan

Children