Hi Filipe,
I can tell you für 2): No. At compile time, the variable name is replaced by a 
fixed memory address. There's no difference if the name is declared inside a 
procedure/function or in the main program. There is, however, a little space 
("access RAM") which contains a bit "faster" variables. So, it can make a 
little difference if a variable is declared earlier or later in a program.
8-bit PIC controllers are a bit special, as in a sense they don't have RAM at 
all, they merely have up to several thousand processor registers. Accessing 
(simple, not array) variables is therefore very fast compared to other 
processor architectures. 
Greets,Kiste
    Am Sonntag, 21. August 2022, 12:49:39 MESZ hat flyway38 
<[email protected]> Folgendes geschrieben:  
 
 Hi all,
Always had this doubt about efficiency in choosing Procedure or Function for 
structuring my code. I know how to use them by experience in coding JAL for 
many years.
Another doubt is declaring VARs inside Procedures or Functions will make them 
slower or not..., so here goes the questions;
1) - Which is the fastest/ efficient at runtime (Procedure or Function) ?
2) - Declaring VARs inside Procs/Funcs will make them slower ?
Thank you very much
Kind regards,Filipe Santos


-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/049c5097-750d-4cf7-845a-a89720963961n%40googlegroups.com.
  

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/294096003.444620.1661079815565%40mail.yahoo.com.

Reply via email to