How to keep my iMac on while my iPhone is restoring?

I'm restoring my iPhone but my iMac keeps turning off/sleeping and stopping and restoring process. How do I keep my iMac awake overnight?

Added (1). Also, my iMac keeps giving me a notification that my iPhone is in recovery mode even though it is restoring at the moment. Is there anything I could do to stop that?

The iMac has a Mac OS version installed on it. Maybe it is OS 10.9.4. For that, try this…
- Open System Preferences > Energy Saver.
- Move the slider.

  • While Restoring iphone 5, how do I get lost texts? I asked my brother to text me right when I started restoring and updating my iphone, and it said it's going to take 2 hours because my laptop sucks. If I don't receive my bro's text when it's done, how can I get back all the texts I received while it was updating and restoring?
  • What happens if you unplug your iPhone 4 while it is restoring? I was restoring my phone because I forgot my passcode. After it got done restoring it asked me if I wanted to restore all of my pictures, contacts, music, etc my little brother unplugged it not knowing what he was doing. What is going to happen to it now? p.s. As soon as he did it I plugged it back in immediately.
  • Restoring IPhone 4, want to keep photos and contacts? I have to restore my IPhone 4 due to the capacity of "other" taking up half the space on my phone. Unfortunately, I'm only 15 and I really don't know what I'm doing. I can live without saving my notes and text messages and such, but i would really like to save my photos and contacts. What is a simple way I can do this?
  • My Iphone 4s froze while restoring? Hi! So I needed to restore my IPhone 4s and my computer decided to restart itself while doing so and now it's stuck on the apple logo screen. When I open itunes, it doesn't even say my phone is connected to it so I can't resume the restoration.