The measure of a company is not how it performs when things are going well. Anyone can be a star when the stars are aligned. But when things turn ugly, the pressure's on for management, as highly adverse conditions separate the men from the boys. Despite an unfavorable environment, General Mills (NYSE:GIS) released a robust earnings report yesterday, overcoming setbacks that have been plaguing the food processing industry.

Caught in a cost squeeze
What kind of setbacks? Many consumer product companies have been fighting commodity cost inflation. Higher dairy costs dumped on Kraft Foods (NYSE:KFT) last quarter, leading to lower earnings. Kellogg (NYSE:K) has been feeling the pinch as well.

General Mills joins fellow companies such as Proctor & Gamble (NYSE:PG), Colgate-Palmolive (NYSE:CL), and Unilever (NYSE:UL), which have managed to overcome higher raw material costs and post higher profits.

Net sales grew 7% for the second quarter, mainly from price and mix. Also, international growth contributed to nearly half of the company's top line, and favorable foreign exchange also contributed to the revenue growth. Costs are certainly creeping up on General Mills, and management estimates inflation will be 7% this fiscal year; it had initially expected it to be 5%. However, management says it has additional pricing and productivity to help fight off much of these rising costs.

The company also faced charges totaling $20 million, or $0.04 a share, for a voluntary recall of Totino's and Jeno's frozen pizzas because of potential contamination.

Despite all of the challenges the company faced this quarter, and its ramped-up consumer marketing efforts (management invested 10% more on marketing its brands this quarter), General Mills managed to increase its earnings per share 6%. Operating profit grew 1.8%, but would have been up 4.7% without the tab for recalling those pizzas.

Is that box shrinking?
General Mills has been a bit cagey this year in the way it has dealt with price increases, choosing to shrink some Big G cereal package sizes instead of upping the price. The effect is the same -- a higher price per unit of product -- but it may cause some consumers to wonder if they need to check their glasses. So far the company reports no adverse impact on sales, but its market share for cereals will bear watching.

While the company's stock has underperformed the market this year, returning a mere 0.83% so far, General Mills' second-quarter results do show that the company can deliver the goods, even under unfavorable conditions.

Related Foolishness:

As Foolanthropy enters its second decade, join us in working to bring financial education to the world's youth. Learn more about Foolanthropy's new direction.

Kraft and Unilever are Income Investor picks, while Colgate-Palmolive is an Inside Value recommendation. Give yourself an early holiday gift with a free 30-day trial to any newsletter.

Fool contributor Timothy M. Otte surveys the retail scene from Dallas. He welcomes comments on his articles, but doesn't own shares of any companies mentioned in this article. The Fool has a disclosure policy.