A person took a loan and purchased a product at a discount of $40. The discount percentage was equal to the rate of interest of the loan. While repaying the money, the interest he had to pay was $80. Find the time taken to repay the loan.
(Assume the interest calcucated for the loan was simple interest.)