Question: runtime_print has the same code as runtime_increment except that instruction 'res = res +1 was replaced with 'print...' instruction. Why does runtime_print take more time


runtime_print has the same code as runtime_increment except that instruction 'res = res +1 was replaced with 'print...' instruction. Why does runtime_print take more time to run? (Purpose: see that not all (1) instructions are the same. Note the big slowdown that comes from function call and accessing the screen versus a simple increment.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
