In hard real time systems, the most important factor is execution time of codes. So when you call functions especially in loops you loss a time for calling a function and return from it. To avoid this lose of time (no need for function call mechanism) put inline keyword in front of a function declaration as shown below:
inline double cube( double x)
{
return x*y*z;
}
No comments:
Post a Comment