What I have found , is that if I am s tudyinglearningmemorizing information , getting a few hours of sleep is more worthwhile than staying up the entire time . If you don ' t sleep at all , you won ' t remember most of the shit you are studying , and you ' ll generally perform worse cognitively than if you had slept for even a couple hours . Now on the other hand , if you are actively working on something i . e . writing a paper , report , or putting together some kind of physical project then working those last 23 hours can be useful in getting the job done rather than sleeping . Sure , you ' ll be more worthless the next day , and sure , the quality of your work may dip , but sometimes in actively writing or creating something , you need those few hours in order to finish things up . Since you don ' t have to remember that information like you would on takin an exam in the morning , it can be beneficial to keep working all through the night , especially if you happen to have any stimulants to assist you . Usually though , the answer to your question is sleep .