Walking stability is achieved by adjusting the medio-lateral and anterior-posterior dimensions of the base of support (step length and step width, respectively) to contain an extrapolated center of mass. We aimed to calculate total recovery time after different types of perturbations during walking, and use it to compare young and older adults following different types of perturbations. Walking trials were performed in 12 young (age 26.92 ± 3.40 years) and 12 older (age 66.83 ± 1.60 years) adults. Perturbations were introduced at different phases of the gait cycle, on both legs and in anterior-posterior or medio-lateral directions, in random order. A novel algorithm was developed to determine total recovery time values for regaining stable step length and step width parameters following the different perturbations, and compared between the two participant groups under low and high cognitive load conditions, using principal component analysis (PCA). We analyzed 829 perturbations each for step length and step width. The algorithm successfully estimated total recovery time in 91.07% of the runs. PCA and statistical comparisons showed significant differences in step length and step width recovery times between anterior-posterior and medio-lateral perturbations, but no age-related differences. Initial analyses demonstrated the feasibility of comparisons based on total recovery time calculated using our algorithm.