I tried to keep myself awake by playing music loudly. It did work to keep myself awake for quite a while before I started to doze off again. Think the best solution is to sleep when one is too tired to do anything.