For some investors, the phrase "stock market millionaire" conjures glamorous images of fast-paced, adrenaline-fueled trading. But the truth is typically more mundane. In most cases, stock market riches arise from boring decisions made on a regular basis over long periods of time.

Warren Buffett has often recommended a low-cost S&P 500 index fund as the most sensible option for the great majority of investors, noting that "by periodically investing in an index fund, the know-nothing investor can actually outperform most investment professionals."

To prove his point, Buffett once wagered $500,000 that a passively managed S&P 500 index fund could outperform a group of actively managed hedge funds over a 10-year time period. Protégé Partners accepted that challenge. The firm selected five hedge funds and tasked more than 200 fund managers with picking stocks.

The bet began during the financial crisis of 2008, a tumultuous period that ultimately saw the S&P 500 lose more than half of its value. But Buffett emerged victorious, and he won by a wide margin. His S&P 500 index fund had achieved a return of 126% (net of fees), while Protégé Partners' best performing fund was up just 88%.

In a nutshell, Buffett beat a team of highly trained professionals without doing any work. Any investor can achieve the same success by mimicking his strategy.

How to build a million-dollar portfolio (or more)

Buffett currently owns two S&P 500 index funds through Berkshire Hathaway's investment portfolio: The SPDR S&P 500 ETF (SPY 1.19%) and the Vanguard S&P 500 ETF (VOO 1.26%). The former is managed by State Street Global Advisors, and it bears an expense ratio of 0.0945%. The latter is managed by The Vanguard Group, and it bears an expense ratio of 0.03%.

Aside from those differences, the index funds are essentially identical. Both offer exposure to 500 of the largest U.S. companies, representing a diversified blend of value stocks and growth stocks that span all 11 stock market sectors. That means either ETF is a fine option for investors looking to build a million-dollar portfolio.

The more important variable is your holding period. The S&P 500 has produced a total return of 1,520% over the last three decades, which is the same as 9.73% annually. At that pace, $150 invested in an S&P 500 index fund on a weekly basis would be worth slightly more than $1 million after 28 years.

This chart shows how three different weekly contribution amounts would grow over four different holding periods. All scenarios assume an annualized return of 9.73%.

Holding Period

$50 Per Week

$100 Per Week

$200 Per Week

25 years

$257,536

$515,073

$1 million

30 years

$426,258

$852,518

$1.7 million

35 years

$694,668

$1.4 million

$2.8 million

40 years

$1.1 million

$2.2 million

$4.5 million

Data source: Chart by author.

This chart also showcases the power of compounding. It may take three or four decades to make your first $1 million, but the second $1 million comes more quickly, and the third $1 million comes even faster.

Is now a smart time to invest in the stock market?

The answer is always yes. No one knows the future, but investing small sums of money in an S&P 500 index fund regularly helps correct for the natural ups and downs of the stock market. That principle is known as dollar-cost averaging. That said, now is an especially good time to invest

Warren Buffett offered the following advice in his 2013 letter to shareholders: "A climate of fear is your friend when investing; a euphoric world is your enemy."

The financial world is currently mired in fear. Inflation sits near a four-decade high, interest rates are rising at their fastest pace since the early 1980s, and both forces threaten to tip the U.S. economy into a recession. That concern has sent the S&P 500 tumbling into a bear market, and bear markets have historically been an excellent time to invest.