Recent

Author Topic: Using getrusage on OSX (+linux)  (Read 955 times)

Grahame Grieve

  • Sr. Member
  • ****
  • Posts: 365
Using getrusage on OSX (+linux)
« on: March 02, 2024, 04:32:31 am »
I'd like to call getrusage on OSX, per https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getrusage.2.html. Ideally, the code will also work on linux.

There's no system routine for getrusage, just an obscure message here: https://forum.lazarus.freepascal.org/index.php/topic,57914.msg431309.html#msg431309 about using syscall. I really don't know what that means.

Syscall on OSX is equally obscure... https://www.pilotlogic.com/sitejoom/index.php/forum/macos-development/5155-using-syscall-and-manipulating-file-permissions-on-macos.html - is that relevant?


How do I use either syscall or getrusage on OSX and linux? (or else, how do I get CPU usage by the process?)

thanks

 

TinyPortal © 2005-2018