Running virus software and computer sleep

Should I turn off my Mac’s automatic sleep mode while running a virus protection scan or will the scan still work while the virus scan is running?

To be honest, I’m not sure, but personally I would turn it off while doing that. I always turn it off when doing any lengthy operation like that.

Thanks for the feedback.