If we forget about any time constraints for this question and instead focus on how well and efficiently you can get a task done, I would like to know if there is ever a time when it's better to keep working on a project/assignment/task until it is done rather than go to sleep or go out and resume working when you can.
The best example of this I have is when I am programming and come across an issue that I can't seem to solve. Personally, I feel like staying up and working until I get the problem solved is better. However, sometimes I struggle to sleep because I am thinking of solutions, but others say that it's always better to leave the work and come back to it. Sometimes this works for me, but often it feels counter productive.
Is it ever better to keep working on a problem until its done and not sleep?