How to Measure Time Complexity of an Algorithm?