Although we don't believe in timing the market or panicking over daily movements, we do like to keep an eye on market changes -- just in case they're material to our investing thesis.

The S&P 500 (^GSPC -0.12%) is within 10 points of its all-time high this afternoon, adding another 0.3% to the 3% gain it has racked up in October. This should have investors wondering if this is still a good time to buy. By many measures, the stock market is certainly not undervalued. Let's take a look at one of the measures that Warren Buffett uses to determine whether the market is expensive or cheap. The metric shows the market is not undervalued; read on to find out more.

Warren Buffett's favorite market metric
Looking at the S&P 500, in 2001 Buffett explained to Carol Loomis in Fortune magazine that determining whether the market is expensive or cheap doesn't have to be complicated at all. Here's the metric Buffett uses:

The market value of all publicly traded securities as a percentage of the country's business -- that is, as a percentage of GNP. The ratio has certain limitations in telling you what you need to know. Still, it is probably the best single measure of where valuations stand at any given moment.

Basically, Buffett divides the total market capitalization of the U.S. stock market by gross national product. For a refresher, GNP measures the value of goods and services that a country's citizens produce regardless of where they live. This includes the value of goods and services that American companies produce abroad.

So how do you tell whether the stock market is expensive? Buffett went on to explain: "If the percentage relationship falls to the 70% or 80% area, buying stocks is likely to work very well for you. If the ratio approaches 200% -- as it did in 1999 and a part of 2000 -- you are playing with fire."

Where is the stock market trading today?
The most common way to calculate the market value of all publicly traded securities is by looking up the market capitalization of the Wilshire 5000, which tracks the largest 5,000 companies in the U.S. with "readily available price data." At the end of September, the market cap of the Wilshire 5000 was $20.6 trillion -- and that doesn't even account for October's run-up.

To find GNP, the Federal Reserve Bank of St. Louis has a great website where you can locate most U.S. economic data. The most recent data for GNP comes from the second quarter of 2013, when GNP was $16.9 trillion.

Dividing the total market capitalization by GNP gives us a percentage of 122%, which indicates that the market is getting pricey.

Final word
With the Federal Reserve committed to low interest rates and pumping money into the economy through quantitative easing, who knows how high the market can go. Investors who are putting new money to work now will likely see low returns going forward. It's getting harder and harder to find great companies at good prices. While investing is simple, it certainly is not easy.