How to calculate run time of insertion sort and Merge sort?
In sorting algorithms you can count the number of comparsions and consider it as run time of worst case. Just add one static counter in your code it will reflect the time complexity in a better form. Otherwise the general approach of calculating run time works fine always. Most language has a function that gives system time.