34 ms·
Huh, I didn't realize the average line of C code worked out to 3-5 instructions.
by MichaelZuo 3y ago
Huh, I didn't realize the average line of C code worked out to 3-5 instructions.
- brucehoult 3y agoIt depends on the line! Many lines of C will translate to a single instruction. Arithmetic expressions generally need one instruction per C operator. Each array access might need one or two extra instructions. A function call will need one instruction to move each argument into place (unless the argument is the result of arithmetic or array/pointer dereference in which case that part is for free), plus one or two instructions to jump to the function being called.