not even 5 minutes....most of the time, less than 1 minute.
I stand by the APC 3000VA UPS's on ebay. Cheapest option for decent reliability. The downside, the batteries will need replacing every 3 to 5 years.
Alternatively you could invest in remote power point/outlet, so if the S2 doesn't reboot correctly you can force a power cycle on it.
I've had s3's after a brown out, that will "mysteriously" keep the IP network settings but reset the mining config to bitmain's. So when you walk past them, they all appear to be working but in fact, they are farming for bitmain, not you. 2 ways to fix that, a monitor on each worker from the pool you are using, and/or add specific routes to your router to redirect or null route bitmain's default mining config.