Hi Holly,
I am not sure how a doctor would know how long you have had an infection in the uterine lining. It would be unlikely that you had a significant ongoing infection anyplace for years since infections have the potential to erode of the lining of whatever cavity is surround them. Perhaps you have recurrent mild infections which your body cleared between episodes.
A biopsy would tell the doctor how much damage/scarring was done to the lining. An ultrasound would show a walled off infectin (abscess),which is highly unlikely.
Take care,
Maria