After hitting some turbulence late last year and in early 2014, shares of Costco Wholesale (NASDAQ: COST) have resumed their steady rise and are now closing in on a new all-time high. With Costco stock up more than 10% since early April, is it time to hop on the train -- or should investors be looking to sell?

COST Chart

Costco 5 Year Price Chart, data by YCharts

Costco stock trades at a higher valuation than most of its retail peers, and this makes for a lot of doubters on Wall Street. However, Costco deserves its premium valuation because of its deep moat and strong long-term growth prospects. As a result, any time may be a good time to buy Costco stock.

Large, but growing
Costco is one of the largest retailers in the U.S. -- and the world. In the just-ended 2014 fiscal year, Costco posted sales of more than $110 billion. (It also takes in about $2.4 billion annually in membership fees.) That's a far cry from the $473 billion in sales generated by Wal-Mart last year, but it puts Costco ahead of other retail heavyweights like and Target.

Size-wise, Costco still pales in comparison to big-box behemoth Wal-Mart (Photo: The Motley Fool)

Despite being so large, Costco is still growing at a nice clip. Excluding the impact of gasoline prices and foreign currency fluctuations, Costco's comparable store sales have now risen 6% annually for four straight years. Including the contribution from new warehouse openings, Costco's revenue is rising at a steady high single-digit rate.

By contrast, revenue growth has been mired in the low single-digit range at both Wal-Mart and Target for the past couple years. Since the Great Recession, Costco's revenue growth has remained consistently above that of both big-box competitors.

COST Revenue (Quarterly YoY Growth) Chart

COST Revenue (Quarterly YoY Growth), data by YCharts

On the other hand, Amazon takes the crown for sales growth. Its revenue grew about 22% last year, and most Wall Street analysts expect Amazon to continue boosting revenue by at least 20% in 2014 and 2015.

A premium valuation
Costco stock has a premium valuation -- its shares trade for 28 times trailing earnings, and at nearly 25 times the average analyst estimate for fiscal year 2015 earnings. Meanwhile, Wal-Mart and Target trade for about 14 and 16 times forward earnings estimates, respectively.

Some Wall Street analysts are skeptical about Costco stock not because they have any qualms about the company's performance, but simply because they think it's too pricey. However, for long-term investors, the price premium is well worth it.

Thanks to its solid growth opportunities and wide economic moat, Costco is likely to grow EPS about 10%-12% a year on average for the foreseeable future. As a result, EPS should triple in the next decade. This creates plenty of room for Costco stock to rise even if the earnings multiple gradually shrinks.

Costco's long-term growth trajectory will drive solid gains for patient investors (Photo: The Motley Fool)

For Wal-Mart and Target, the future earnings picture is much murkier. Amazon's long-term earnings trajectory is even less clear. The market has rewarded Amazon with a $160 billion market cap -- three times that of Costco -- even though it is not expected to make any money this year.

Foolish wrap
For investors, Costco represents a happy medium between other big-box retailers like Wal-Mart and Target and top e-commerce competitor Amazon. Costco stock does trade at a premium relative to shares of Wal-Mart and Target. However, Costco's strong moat (created by rock-bottom prices) and long-term growth trajectory fully justify paying more.

On the other hand, Costco stock looks very cheap compared to that of Amazon. Costco trades for just 0.5 times sales, whereas Amazon trades for about two times sales -- a remarkable gap given that Amazon has not been consistently profitable for several years, whereas Costco's margin performance has been very reliable historically.

In short, while Costco stock is more expensive today than it was this spring, it's still a good time to buy if you have a long-term mind-set. Costco's strong growth and steady margins will allow the company to create lots of value for shareholders in the coming decades.

Adam Levine-Weinberg owns shares of Costco Wholesale. The Motley Fool recommends and Costco Wholesale. The Motley Fool owns shares of and Costco Wholesale. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.