vb.net Code:
While F(3) For Each P As Process In Process.GetProcesses If P.ProcessName = "Neutron" Then F(3) = False 'Neutron is running. Next End While While F(4) F(4) = False 'Neutron has closed. For Each P As Process In Process.GetProcesses If P.ProcessName = "Neutron" Then F(4) = True 'No, hang-on... Neutron is still running. End If Next End While
Ok I've no idea what the purpose of F(3) and F(4) is in the wider context but don't those two loops do exactly the same job, ie. determine whether 'Neutron' is running? And do you really want to hold up the program in its entirety when it is? As has been suggested you should activate the timer only when it becomes necessary to check whether Neutron is running. On tick, if it is running, do nothing. If it is not, update the displays, and stop the timer.




Reply With Quote