Typically the attacks don’t take 10 hours… they take seconds, what takes time is getting the captured device a laboratory and the laboratory having time to look at it. So what will happen usually is the phone is put into a faraday bag, hooked up to a usb charger, and put on a shelf until the laboratory can get around to it.
Once the lab starts attacking the phone, it could take seconds as I said above, but some attacks are more involved requiring the phone to be disassembled and leads soldered onto the board. The restarting is about reducing the time the lab has before they can start and finish their attack
The same process applies to computers and laptops as well, there are lots of mouse jigglers for sale to prevent a screen saver from going on.
For as long as you can’t stand it