The last place I would ever want to be trying to work while going for any length of time without sleep is at sea. The office did not appreciate that I knew there were legal limits on how long I was allowed to be at the helm, and I did say "That's it. I'm going to bed."
Spending 12 hours or more at the helm was actually kind of normal, at times, and that was the legal limit. But when you got above 15 hours, your skills and thinking dropped. There were a few times I went a little too long and found myself heading into trouble. I can recall images of the bow of a container ship looming. Brain functioned kicked in for a while, and then, adrenaline got me through until I got to my bunk.
I know had I stayed awake the took the helm or conn after being for 48+ hours, my crew and myself would have been at risk. If I was in trouble and needed to do it to get out, well, I would, but that's the only excuse.
A very skilled and experienced harbor pilot once told me you needed two things to do that job: "Some common sense and a set of balls." Working on too little rest is not enough of the first and perhaps too much of the second. Keeping my crew awake and working for extended periods would have been a lack of common sense, in almost all circumstances.