Yea snacking on food definitely helps with that stuff and actually I find company helps a lot too like if your working on a project with a partner or something.
I stayed up for 45 hours straight to finish up my senior design project back in July, my partner and I started at 8am saturday thinking we would bang it out that night and then ended up working through that night and then through sunday night I went back to my room and slept from 5-8am and then came back and finished up the project and passed it in at noon when it was due.
I bet your bed will be the most comfortable place on the world come 3pm, and then you can sleep through the evening/night and wake up well rested the next morning lol