here is the article which shows the methods. https://programmingoneonone.com/how-to-calculate-running-time-of-algorithm.html