Running out of money before you die has to be one thing many retirees fear most. In fact, a recent survey by Allianz Life found that far more retirees are afraid of outliving their money than they are of dying itself  — and it wasn’t close: 61 percent to 39 percent.

And with a bear market rearing its head of late, many retirees are getting anxious. Over the past three months, the S&P 500 dropped more than 20 percent on an intraday basis, and retirement planning projections made at the end of the third quarter, as the market was hitting all-time highs, need to be reevaluated.

But fear not, MarketWatch’s Mark Hulbert says:

The reason not to give up hope is that the stock market typically recovers from bear markets in a far shorter period of time than most doom and gloomers think. Consider what I found when measuring how long it took, after each of the 36 bear markets since 1900 on the bear market calendar maintained by Ned Davis Research, for equities to make it back to the bull market highs that preceded those bear markets. My measurements took into account dividends and inflation, which is important because analyses based on nominal price action alone exaggerate bear market recovery times.

Believe it or not, the average recovery time was “just” 3.2 years. Assuming the bear market that began at the end of September ends today, and assuming the recovery time lives up to historical averages, the stock market will once again trade in new-high territory in December 2021.

Furthermore, it wouldn’t take even this long if it weren’t for some outliers in the calculation of this historical average. The median recovery time—that length of time such that half of the bear market recoveries were shorter and half longer—is 1.9 years. Assuming the recovery time equals this median, the stock market will once again be in new-high territory in September 2020.

To be sure, there’s no guarantee that the future will be like the past, of course. And even if it is, the recovery time from the current bear market could end up being longer than the median or the average.

But even then we need to exercise care not to exaggerate the recovery time. Take the financial crisis, which led to the worst bear market since the Great Depression. By my calculations, the stock market on a dividend-adjusted inflation-adjusted basis took 5.4 years to overcome that bear market and surpass its pre-bear-market high from October 2007—March 2013, in other words.

And while 5.4 years is a long time, it doesn’t have to be devastating. For example, that recovery time is less than the life expectancy of any male currently aged 86 or younger, according to the actuarial tables at the Social Security Administration. Any female aged 90 or less has a life expectancy greater than this recovery time from the financial crisis. Most retirees that old should have long since reduced their equity exposure, of course.

What is far more likely to make the current bear market devastating is not the recovery time but throwing in the towel at the bottom, going to cash, and not getting back in until the stock market has produced a significant rally. If you do that, you are guaranteed to suffer 100% of the losses and benefit from only a fraction of the recovery.

The losses we’ve endured since late September are painful. But we’ve already incurred them. Going to cash only adds insult to injury—unless you happen to be the rare market timer who succeeds in getting back into equities at a lower level than where the market stood when you get out.