Hi community!
I hope you can help me on that or at least you can clarify my doubt.
In my App for Mac (macOS, Swift, Xcode .. everything is at the latest official version) I need to get the System Uptime and for this reason I use this API (ProcessInfo/processInfo/systemUptime):
https://developer.apple.com/documentation/foundation/processinfo/1414553-systemuptime
This is my fragment of code:
let systemUptime = ProcessInfo.processInfo.systemUptime
Executing it right now I get the following values (in seconds): 32967.776459317 which is about 9 hours, while getting the System Uptime from the Terminal I get (correctly): 1 day, 12:27
My questions is obviusly, how can I get the correct System Uptime using Swift?
Thanks in advance for your time and help!