Eating before a workout - Optimal Time

If I eat 3 hours before a race I get hungry about 30 minutes before start. When I eat an hour or less before start then I feel ok.