Bristol Myers Squibb (BMY -0.87%) has been a top healthcare stock to own for decades. It had eight blockbuster drugs last year that generated more than $1 billion in annual revenue, including top-selling cancer drug Revlimid, which brought in nearly $13 billion all on its own. The company has gotten bigger over the years via acquisitions, and it also rewards investors with a generous yield that pays 3% per year.

But has this been a good investment to own lately? Below, I'll look at how much you would have made from a $10,000 investment in the stock five years ago and whether it's a good decision to invest in the business today.

The stock has generated modest gains in five years

At the end of October 2017, shares of Bristol Myers closed at $61.66. A $10,000 investment back then would have been enough to purchase just over 162 shares of the company. This past Tuesday, shares of Bristol Myers were trading around $73, which would put the value of those shares now at $11,839. That comes out to a return of just 18% over a five-year stretch.

That equates to a compound annual growth rate of only 3.4% -- well short of the long-run S&P 500 average of around 10%. Suffice it to say investors may be underwhelmed by these types of returns.

These returns, however, do not include dividends. When including the company's recurring payouts, the stock's total returns over the past five years rise to 34%, although that's still lower than the broader index, which is up 62% during that time frame. While Bristol Myers has made for a safe investment to hold over the past five years, it's hard to make the case that it has been a great one. 

Why investors shouldn't give up on the stock

Bristol Myers may not be a hot and exciting growth stock that could double in value, but it still makes for a sound investment, especially during challenging times. This year, for instance, it has given investors a safe place to hold their money. Year to date, its total returns are around 21%, while the S&P 500's returns, including dividends, are still a negative 19%.

The stock is a low-volatility investment that risk-averse investors can safely hold for decades. But it's not as if the business isn't growing. In March, the Food and Drug Administration approved a combination treatment of relatlimab and Opdivo to treat advanced melanoma. The lucrative treatment could generate over $4 billion in annual revenue at its peak.

While the company's drugs are facing growing competition, Bristol Myers is confident that, in the long run, it can more than offset losses in exclusivity with a strong pipeline. In 2029, for example, the company anticipates that new products will contribute at least $25 billion in revenue as Bristol Myers has over 50 assets that are still in their early stages of development. That's more than half of the $46 billion in revenue the company generated in 2021.

Is Bristol Myers stock a buy?

Bristol Myers hasn't been a top stock when looking at its returns over the past five years, but the future remains bright for the healthcare company. It has plenty of growth potential and solid fundamentals, including consistent profits, and it also pays a great dividend. You may sacrifice some gains in exchange for some safety with Bristol Myers, but overall, it makes for a sound long-term investment to hang on to for years.