1 Matching Annotations
  1. Mar 2022
    1. What is benchmarking?Suppose I have a code snippet and I want to test its execution time. What to do?The easiest way for that is, find the current millisecond before the method and also find the current millisecond after the method. then find the difference between both which is the execution time for that particular method.Here the total execution time is calculated from a single iteration. So the result is not much accurate. If you want to make the result more accurate then want to run the method several time and need to find out an average of all execution. But for that, you need to do extra code in the main method.

      在medium中使用gist嵌入代码示例#Write