Prevent App Nap Programmatically

from blog The Desolation of Blog, | ↗ original
App Nap is a technology introduced in Mac OS X 10.9 Mavericks. Under certain conditions, such as when an app is not visible on the screen, App Nap automatically puts the app into low power state in order to extend battery life. This can cause problems if the app is performing time-sensitive tasks, which may get delayed or interrupted. Unfortunately, App Nap was designed as opt-out rather than opt-in, which means that App Nap can affect an app even if the developer didn't expect or plan for it. You can see apps going in and out of App Nap by watching the Energy tab in Activity Monitor.