Wakeup from sleep taking long time


After installing one of the High Sierra upgrades, my mid 2011 27" iMac takes 20 to 30+ seconds to wake up after pressing the spacebar.
I have tried resetting the PRAM and the NVRAM but neither helped the situation.
Many forum posts seem to indicate the same problem with Macbooks, but I have never seen a fix the worked.
Any suggestions or solutions would be appreciated.
I suggest reinstalling High Sierra:
Make a bootable High Sierra installer, if you don't have one.
Boot to that, and reinstall.
The directions on creating a bootable installer is no longer valid. Searching for High Sierra displays only a Connect my Tablet app.
The links in the article go to iTunes not the App Store and no High Sierra can be found there.
The macOS reinstall will reload the standard system files, and standard system apps. The reinstall, by itself, should not affect your own installed apps, or your user documents, music, pictures, etc.
But, it never is a problem if you have a current backup before any major install or system update. And, a backup plan is something that you should have already.
bottom line: The reinstall does not erase anything other than what is needed for reinstalling system files --- unless YOU choose to open Disk Utility, and erase the drive first.
I had the same problem with Mojave. Low and behold this advice from an Apple forum actually worked. Reset SCM and PRAM. Which one did it? I have no idea, but this may be the first time I ever received useful advice from the apple forum: https://discussions.apple.com/thread/250007076

So, try SCM reset before all this reinstall stuff! Instructions for your mac in a link in the above link. For an iMac, it was simple. Power off, unplug power cord for 15 seconds, wait 5 seconds, restart. Reset PRAM for kicks.