Retail giant Costco (NASDAQ:COST) operates under the mission to "continually provide our members with quality goods and services at the lowest possible prices."

That simple strategy has rewarded Costco's shareholders handsomely, both recently and over the long run. The stock has delivered a 43% return over the past year, compared with a 26% gain for the S&P 500 market index. The 186% gain of the S&P 500 over the past 10 years works out to an average annual increase of 11%, but Costco's stock quintupled over the same period for an average gain of 17.5% per year.

Has Costco burned all of its rocket fuel or is the warehouse club still a great investment?

Sky-high valuation

Costco's stock is not trading at "the lowest possible prices" nowadays. These shares fetch a princely valuation of 36 times trailing earnings or 40 times free cash flows. That's expensive compared to industry peers such as Walmart (NYSE:WMT) or BJ's Wholesale Club Holdings (NYSE:BJ), and also among the pricier ratios Costco has seen in recent years:

COST Normalized PE Ratio Chart

COST Normalized PE Ratio data by YCharts

Strong results

Those big gains were built on a rock-solid financial foundation. Costco grew its top-line sales faster than other major retailers in 2019, including a stellar 9% increase in same-store revenues in December. Membership fees -- which typically account for the vast majority of Costco's bottom-line profits -- increased by 6% to $804 million in the first quarter of fiscal year 2020.

And this company won't get caught flat-footed by the e-commerce trend. Costco's own online sales are pulling their weight, and then some.

"Total online grocery continues to grow at a faster rate than the core e-commerce comps, although again it's a still relatively small piece of the business," CFO Richard Galanti said in the first-quarter earnings call. "We also during the quarter launched as a test, in a few locations, same-day prescription Rx delivery with Instacart, and we launched in the quarter same-day alcohol delivery also through Instacart in California such that as of today, it's being offered in 12 states."

That doesn't mean Costco is ready to copy the online strategies of every other retailer without vetting each idea with thorough research.

"As it relates to buying online then pick up in-store, we continue to look at what others do and continue to scratch our head," Galanti said. "We look at it, but we're not at a point that we're planning to do anything with it."

Photo of a Costco warehouse from the outside, featuring the company logo in large red and blue letters.

Image source: Costco.

The upshot: Costco is worth every penny in the long run

You know that time-tested Warren Buffett adage -- it's better to buy great companies at fair prices than betting on fair companies at great prices.

Costco is a great company and its stock deserves to trade at a premium to the broader market. There might be times when Costco's shares fly a bit closer to the ground, triggering an obvious buy-in window during some random dip, but that's far from a sure thing. If you thought the stock looked expensive in the spring of 2015, after tripling the S&P 500's returns over the previous 52 weeks, you should consider that the stock has doubled in five years from the highest price recorded in that seemingly overheated spring.

Costco is a no-brainer buy at nearly any price, including right now. Market timing is a guessing game at best, anyway.