I have a Mac OS application …
Just to confirm, this is macOS, right? I see this question a lot, but it’s mostly from iOS folks who missed the memory about apps being suspended in the background.
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
Hi Quinn (or should I call you "Eskimo"?),
Yes, Mac OS it is. I realized after I had placed the original post that I hadn't specified, and edited it accordingly.
My app continues to run correctly for some time after moving to the background, but I would like to know how to make it keep running correctly in the background. The app will eventually be doing some audio processing too which must also continue to run no matter what.
You are probably falling victim to App Nap, which can delay timers. You can use techniques described in the Energy Efficiency Guide for Mac Apps to control that. See the articles in the Prioritize Work and Schedule Work sections.