The heady days of 2007 seem like so long ago. Stock markets were hitting record highs, and peripheral worries about subprime mortgages hadn't yet blossomed into the full-blown financial catastrophe that would ensue over the next year and a half.

After what we've all gone through, plenty of folks are looking longingly back at those days, wondering if we'll ever get back to those highs. According to at least one study, though, you shouldn't hold your breath -- it could be a decade or longer before the market recovers all of its losses.

A look at history
In an examination of bear markets throughout history, London Business School finance professor Elroy Dimson looked at the likelihood of seeing stock markets recover in the future. Using calculations based on the historical average return of stocks over the long haul, Dimson says there's only a 50% chance that the market will hit new highs by 2018.

As grim as that prognosis may sound, it's a good reminder of how hard it is to earn back major losses. Keep in mind that having lost 50% of its value, the stock market doesn't just have to rise 50% to get back to even -- rather, it has to double. Even in the best of times, it's generally taken years for the market to do that -- three years during the hottest part of the boom of the 1990s, and five years from the post-tech bust lows of 2002 to 2007.

Still, while it may take the markets that long to recover, your own portfolio may get back to even a lot quicker. How will it happen? The answer is in dollar-cost averaging.

Keep on adding
If you've invested for any length of time, you've probably heard about dollar-cost averaging. The idea is that if you regularly invest the same amount in a stock or mutual fund, you may end up doing better than someone who simply invests a lump sum at the beginning of a period. The reasoning behind dollar-cost averaging is that you buy more shares when stocks are cheap and fewer shares when they're expensive, which tends to decrease your overall cost.

Not everyone likes dollar-cost averaging, though. Because the market tends to rise over time, one counterargument goes, you should get all of your money into the market as quickly as possible.

Still, many don't feel comfortable with that all-or-nothing approach. Moreover, most people don't have those lump sums to invest -- they save over time. So, dollar-cost averaging makes intuitive sense -- and it's what will help you get your portfolio back above water faster than you'd otherwise be able to do.

The benefits
As an example, say you had a portfolio of stocks that were hit hard in the tech bust. If you had made a one-time large investment near the top at the beginning of 2000, you would have lost a huge amount over the next three years. As you can see below for certain stocks, you never would've broken even on some of those purchases.

Stock

Return 2000 to 2003

Return 2000 to 2008

Break-Even Date

Microsoft (NASDAQ:MSFT)

(55.7%)

(28.4%)

Never

Intel (NASDAQ:INTC)

(61.9%)

(30.5%)

Never

Amazon.com (NASDAQ:AMZN)

(75.2%)

21.7%

July 2007

Dell (NASDAQ:DELL)

(47.6%)

(51.9%)

Never

Cisco (NASDAQ:CSCO)

(75.5%)

(49.5%)

Never

Yahoo! (NASDAQ:YHOO)

(92.4%)

(78.5%)

Never

Oracle (NASDAQ:ORCL)

(62.4%)

(19.4%)

Never

Source: Yahoo! Finance. Returns from Jan. 1. Data reflects first break-even date after January 2003.

Now compare that experience with another investor who didn't have a big amount to invest in 2000, but who invested the same amount at the beginning of each year beginning in 2000. Even with the same stocks, this investor has a much different experience.

Stock

Return 2000 to 2003

Return 2000 to 2008

Break-Even Date

Microsoft

(14.6%)

33.7%

Nov. 2004

Intel

(40%)

10.2%

Aug. 2003

Amazon.com

5.2%

231.1%

May 2002

Dell

0.4%

(13.6%)

Jan. 2001

Cisco

(42.2%)

20.7%

Nov. 2003

Yahoo!

(36.4%)

26.5%

April 2003

Oracle

(36.5%)

42.5%

April 2006

What happened? Two things helped the second investor: not risking everything at the top, and continuing to buy near the bottom.

The key is sticking with your long-term investing strategy. For most, that means continuing to buy stocks at their current low levels. By having more shares, you'll reap more of the benefits of a recovery faster -- and with some good fortune, it won't take a decade before you see your net worth climb back over its 2007 levels.

For more on investing in a tough market, read about:

Build a winning investment strategy with the help of Fool co-founders David and Tom Gardner. Their Motley Fool Stock Advisor newsletter features market-beating picks for any market environment. Give it a try today, for free, with a 30-day trial.

Fool contributor Dan Caplinger loves to add a little every month. He doesn't own shares of the companies mentioned in this article. Microsoft, Intel, and Dell are Motley Fool Inside Value selections. Amazon.com is a Motley Fool Stock Advisor pick. The Fool owns shares and covered calls of Intel. Try any of our Foolish newsletters today, free for 30 days. The Fool's disclosure policy won't let you make a mistake.