First of all, let me get from my chest the fact that I am a greenhorn trying to do something right, which means that from time to time I get a contradiction about what is right.
I change the driver for the periphery, which contains a function - lets call it Send() . In the function, I have a timestamp variable, so the function cycle for a certain period of time.
So, should you declare a global variable (that way, it is always in memory and no time is wasted declaring it every time the function starts) or do I leave the variable local in the context of the function (and avoid the bad design of the template with global variables)?
Please keep in mind that a function can be called several times in a millisecond.
source share