Animals generally forage on inhomogeneous landscapes, where nutritional content varies in space and time. Therefore they need to assess the benefit of immediate intake versus waiting for better times. The process of feeding itself incurs an energetic cost in most animals, which poses a cost-benefit question: is the environment nutrient rich enough to exceed the cost, or is it favorable to wait and not expend energy trying to feed on scarce feeding grounds. We study this decision-making process in the nematode C. elegans, a model organism that allows us quantify feeding behavior. I will describe technology that I developed to analyze feeding behavior and show that the temporal dynamics that it reveals are more complex than previously assumed. I will then discuss how to frame these observations in a simple model influenced by ideas taken from decision theory.