After a tumultuous year, things are starting to look up for the stock market. The S&P 500 is currently up by more than 11% so far this year, and the tech-heavy Nasdaq has surged by nearly 26% in that time.

While experts are still sounding the alarms over a potential recession, many investors are wondering if the worst of this bear market is already behind us.

In short: It's impossible to say. But there is a better question you can ask to decide whether now is the right time to invest in the stock market.

Gold bear and bull figurines.

Image source: Getty Images.

Where will the market be 10 years from now?

It's easy to get caught up in the stock market's short-term fluctuations. It's also tempting to try to invest at just the right moment when prices bottom out so that you can take full advantage of the recovery period.

However, while this strategy may sound smart in theory, timing the market effectively is next to impossible to pull off. Stock prices can be unpredictable, and even the experts can't say for certain where the market will be a week or a month from now.

One of the best things you can do right now, then, is to keep a long-term outlook. Rather than trying to determine when the market has bottomed out, simply invest consistently and focus on where the market will be 10 or 20 years from now.

Historically, the market has a fantastic record of seeing positive total returns over time -- despite short-term volatility. Regardless of when exactly you invest, you're far more likely to see positive returns if you maintain a long-term outlook.

What if you invest at the "wrong" time?

One of the most difficult parts of investing during periods of volatility is the concern that you could invest right before prices drop. Not only will your portfolio immediately lose value, but if you'd waited just a little longer to buy, you could have snagged lower prices.

Over the long haul, though, it may not make as much of a difference as it seems. For example, say you had invested in an S&P 500 index fund in January 2008 -- immediately before the market bottomed out amid the Great Recession.

At the time, that may have seemed like the worst possible moment to invest. But over the next 10 years, you'd still have earned returns of more than 82%.

^SPX Chart

^SPX data by YCharts

Now, could you have earned more if you'd invested at the exact moment the market bottomed out? Of course. But hindsight is 20/20, and it would have been impossible to know at the time when prices were at their lowest. If you'd waited too long to buy, you'd still have missed out on potentially substantial returns.

Don't wait for the perfect time to invest

It's extremely difficult to time the market accurately enough to invest at precisely the right moment. But when you invest consistently -- throughout the highs and lows -- you can still take advantage of the dips.

Over the long term, this strategy is far more likely to help you make money. In fact, data from Crestmont Research found that every year since 1919, the S&P 500 has earned positive 20-year total returns.

In other words, if you had invested in an S&P 500 index fund at any point and simply held it for 20 years, you'd have earned positive total returns -- regardless of how volatile the market was during that time.

The past year has been rough on investors, so if you're feeling cautious about the market right now, you're not alone. But by investing consistently and keeping a long-term outlook, you won't need to worry as much about the short-term ups and downs.