Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6566117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:10:43+00:00 2026-05-25T14:10:43+00:00

Right now I’m doing something like this: NSString *pullProcesses = @ps axco pid,pcpu,user,command; system([pullProcesses

  • 0

Right now I’m doing something like this:

NSString *pullProcesses = @"ps axco pid,pcpu,user,command";
system([pullProcesses UTF8String]);
NSLog(pullProcesses);

It’s a bit inefficient though, pulling about 15% CPU each time it’s called.
Is there any efficient way for me to get a list of processes and the amount of CPU it’s using?

Furthermore, is there a way to break that list of processes down into ones that only belong to the user and are not system processes?

I’m hearing that NSTask may work, but this isn’t checking all of the user’s processes, only the ones active in the dock.

I’m also reading things about NSWorkSpace, but I’m not sure what the best way to do it is.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:10:43+00:00Added an answer on May 25, 2026 at 2:10 pm

    Well, -[NSWorkspace runningApplications] will get you the list of user processes, represented by NSRunningApplication instances. An NSRunningApplication has a processIdentifier property, holding the pid_t of its process, which you could then pass to ps — this might be more efficient.

    Also take a look at Apple’s sample project called “AppList”; it demonstrates using NSWorkspace and NSRunningApplication, although I can’t remember if it displays CPU usage.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I'm doing something like this: RewriteRule ^/?logout(/)?$ logout.php RewriteRule ^/?config(/)?$ config.php I
Right now, I have code that looks something like this: Private Sub ShowReport(ByVal reportName
Right now when i do something like this: use strict; use warnings; package My::Test;
Right now my ant task looks like. <javadoc sourcepath=${source} destdir=${doc}> <link href=http://java.sun.com/j2se/1.5.0/docs/api/ /> </javadoc>
this is what i have right now Drawing an RSS feed into the php,
right now Im searching for like 6h to get into it! My brain is
Right now I have an asp:Wizard with 3 Steps. Create User Form to Email
Right now, I'm using this fashion: window.Foo = { alpha: function() {}, bravo: function(arg)
Right now it contacts the server every time a user toggles Comments (X) I'd
Right now I clarify this may be a duplicated question from: Right-aligned labels in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.