none
process counter RRS feed

  • Question

  • Hello, everyone!
    I'd like to introduce you to my problem=)
    It is caused by using function GetProcessByPid(System.Diagnostics.Process) in project that verifying if there is more than one process with the same name registered in the System.
    That function works a lot of time...About 1000ms each time. The whole Loop contains about 60 times -> so total time ~ 1min.
    What's the problem?Is it normal?
    Thank You
     
     
    Friday, December 14, 2012 8:04 AM

Answers

  • But what is the problem, do you get any error or unexpected behavior ?

    In addition to GetProcessById you have this methods too:

    System.Diagnostics.Process.GetProcesses

    System.Diagnostics.Process.GetProcessesByName

    Both return an array of Process, do this helps you ?

    Maybe this helps too:

    http://stackoverflow.com/questions/262280/how-can-i-know-if-a-process-is-running


    -

    Friday, December 14, 2012 6:50 PM

All replies

  • But what is the problem, do you get any error or unexpected behavior ?

    In addition to GetProcessById you have this methods too:

    System.Diagnostics.Process.GetProcesses

    System.Diagnostics.Process.GetProcessesByName

    Both return an array of Process, do this helps you ?

    Maybe this helps too:

    http://stackoverflow.com/questions/262280/how-can-i-know-if-a-process-is-running


    -

    Friday, December 14, 2012 6:50 PM
  • Hi Christyakov,

    Welcome to the MSDN Forum.

    Does Enrique's answer help you? 

    If not, please provide a repro steps. Thank you.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, December 18, 2012 2:22 AM
    Moderator