Visa's (V -0.20%) performance is often directly correlated with the economy. That makes a lot of sense, since Visa is the largest credit card network in the world and powers trillions of dollars in global money moving.

The common argument is that the economy is in growth mode more frequently than not, and therefore, Visa is growing more often than not. That makes it an excellent contender as a reliable, no-brainer stock to create shareholder value.

The past five years have been anything but calm for the economy. There have been some pockets of enormous growth along with wild swings down, culminating in the current inflationary atmosphere. So if you'd invested $1,000 in Visa stock, what would it be worth today?

It powers the economy, but can it power your portfolio?

If you'd invested $1,000 in Visa stock five years ago, today you'd have $1,767, dividends included. That's not too bad, and it implies a gain of 77%. However, it's less than you'd have made if you'd invested in the S&P 500, where you'd have $2,015.

So does this mean you shouldn't invest in Visa stock? Not so fast. I wouldn't take this small slice of Visa's lifetime, as long as five years feels, as indicative of Visa's prospects.

If you look at other time periods, it has crushed the broader market. If you'd invested $1,000 in Visa stock 10 years ago, you'd have $5,711 today, and only $3,387 if you'd invested in the S&P 500. If you'd consider the five years leading up to the pandemic, you'd see your Visa investment turn into $3,257 versus $1,681 from the S&P 500. These past five years have featured turmoil, and Visa is reliable as a safe stock during times of economic upheaval, even if it's lagging the market.

Long-term investing is more than five years if you want to benefit from its sharpest impact. Just getting started, adding money over time, and staying in is the recipe for long-term investing success, and Visa is a great stock to make that happen.