You have to know when it's ok, for how long, where you are etc. If I'm approaching a shipping lane, I may heave to in day light and sail into when rested . If you are heading towards a coast line
, heave to and set the hand crank egg timer for 15 minuets, and cat nap. but to say it's not ok to sleep is to say single handed ocean crossings, circ's, etc. are not ok. And it's probably not ok if you don't do it prudently and properly. Single handling isn't for everyone and for some like me it's all there is. It's why I sail.