-3

I have 9 buffers that I need to send over CAN. I have a function that has 9 parameters, representing the code for which variables I want to have in each buffer. The function contains 9 switch-case. The question is: will this be faster if I have 3 functions each with 3 parameters? So instead of calling one function with 9 parameters, it's faster to call 3 functions with 3 parameters?

4

1 回答 1

0

也许有一点点,但是当你试图弄清楚要调用哪个方法时,你可能会失去更多。

此外,可能的增益比 IO(CAN 总线)小几个数量级,因此您应该专注于创建可读且正确的代码。

于 2012-10-22T12:31:51.440 回答