Jump to content

'While'


pintas
 Share

Recommended Posts

I was making a big script and everytime i started it i noticed the processor went crazy. After some tests, i found out that the 'while' loop was the cause for it.

For example:

While 1
If ProcessExists("notepad.exe") Then
ProcessClose("notepad.exe")
Endif
Wend

This makes my processor use about 80% to 100% of it's capability. My centrino isn't much, but is this normal?

What can i do to preserve the processor resources?

Thank you.

Link to comment
Share on other sites

Link to comment
Share on other sites

While 1
If ProcessExists("notepad.exe") Then
ProcessClose("notepad.exe")
Endif
sleep(1000)
Wend

should stop the processor usage.. its becuause the Ifstatement is constantly being called .. with no breaktime.

Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...