Which of the following are ways to benchmark code?
A
Timing the code
B
Calculating the number of operations performed
C
Timing the code & Calculating the number of operations performed
D
Calculating the number of lines
Correct Answer: Timing the code & Calculating the number of operations performed
There are a couple of ways to benchmark code—either by timing it or by calculating the number of operations performed during execution. Both of them help in calculating how efficient and modular the code.