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

  • SEARCH
  • Home
  • 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 188213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:58:00+00:00 2026-05-11T15:58:00+00:00

So I’m currently working on a project that needs to time when certain processes

  • 0

So I’m currently working on a project that needs to time when certain processes are running. I’m trying to figure out the most efficient way to scan the process list, then check the process list executable names against the list of supported programs.

Essentially the problem is two parts:

1) Most efficient way to get the process executable names from the process list

2) Most efficient way to compare this list to another list

For (1), one of the other developers was playing around with using the tasklist command and parsing out the executable names. I also found out that C# has a System.Diagnostic process list that will do this automatically. We’re still trying to decide between Java and C# so I probably would lean towards a language neutral solution, but this could be a deciding factor for C#.

For (2), supported process list might be small on average (1-10 process names). We could just run each process through the list, but we were thinking this might be too much for older PCs, so we were tossing around the idea of using an alphabetically balanced AVL tree containing the initial process list when the application starts, and checking everything against that first, and then checking against our supported process names list if its not in the tree.

Any suggestions are greatly appreciated.

Edit: Apparently you can filter tasklist by process executable name, so we could just do that for every process on the supported process list.

Edit 2: Is there a tasklist equivalent that works for Windows XP Home ?

  • 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. 2026-05-11T15:58:00+00:00Added an answer on May 11, 2026 at 3:58 pm

    If you go with tasklist, it might actually be faster to just run the command once and get back all of the results, rather than running it for each of your executable names. There is some overhead for exec’ing a process, and getting the output. (When you get back the results, you’ll have to loop through them in code, but this might be faster. Normally there won’t be more than 100 processes running at once, so it won’t be too bad.) You should write a test and check to see if that’s true.

    In C#, Process.GetProcesses() is the best way to go.

    In Java, there isn’t really an equivalent class/method. Getting a process list is pretty OS-specific, so the Java designers must have decided not to integrate/abstract this capability into the base Java classes. You’ll probably have to Runtime.getRuntime().exec(‘tasklist.exe’) to get the results on Windows, or exec(‘ps’) on Unix/Linux.

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

Sidebar

Ask A Question

Stats

  • Questions 92k
  • Answers 92k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I figured it out. In addition to the aforementioned code,… May 11, 2026 at 6:25 pm
  • Editorial Team
    Editorial Team added an answer The ReSharper can do this: Options -> Code Cleanup ->… May 11, 2026 at 6:25 pm
  • Editorial Team
    Editorial Team added an answer I'd look at a few things: Make sure that the… May 11, 2026 at 6:25 pm

Related Questions

So I'm getting a new job working with databases (Microsoft SQL Server to be
So I have a Sybase stored proc that takes 1 parameter that's a comma
So I'm embarking on an ASP.NET MVC project and while the experience has been
So I've got a JPanel implementing MouseListener and MouseMotionListener : import javax.swing.*; import java.awt.*;
So I wrote some perl that would parse results returned from the Amazon Web

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.