Apple AAPL and Amazon AMZN are two of the richest companies in the world, and both have helped shape the modern economy. Both stocks would have also been some of the best investments ever, had investors bought AAPL or AMZN years ago, but it’s not too late to get in on the action. So let’s see which stock looks like the better buy at the moment.

Core Business Strength

Amazon is an e-commerce giant that saw its net product sales surge roughly 29% to hit $31.86 billion last quarter, which helped its overall Q2 revenues soar 39% to $52.9 billion. Amazon’s cloud computing business skyrocketed 49% to reach $6.12 billion. AWS also experienced a 12% sequential gain, which helped it cement its place as the largest cloud provider.

Amazon reportedly grabbed 34% of the total cloud computing market during the second quarter, according to Synergy Research Group, which crushed Microsoft’s MSFT 14%, IBM’s IBM 8%, Google’s GOOGL 6%, and Chinese e-commerce counterpart Alibaba’s BABA 4%.

Meanwhile, Apple’s most recent quarterly revenues climbed by 17% to reach $53.27 billion. The firm’s adjusted earning skyrocketed 40%. Total iPhone revenue also surged by 20% to $29.91 billion. But, total iPhone unit sales climbed by only 0.7% to 41.30 million. The contrast between iPhone revenue growth and unit sales helped demonstrate how much the high-priced iPhone X has helped Apple.

New Growth Opportunities  

Apple and CEO Tim Cook have known for a while that the company needed to diversify beyond its flagship smartphone that helped propel Apple into the trillion dollar titan it is today. The company’s services business, which includes AppleCare, Apple Music, and Apple Pay, saw its quarterly revenues climb 31% reach $9.548 billion.

Apple Music has quickly become a Spotify SPOT competitor in the U.S. Plus, Apple’s mobile payment service completed more total transactions than Square SQ and more mobile transactions than PayPal PYPL last quarter. Cook also said on Apple’s Q3 earnings call that it is on track to double its 2016 services revenue by 2020, which would see the unit hit roughly $50 billion.