Jump to content
Sign in to follow this  
Hellfire

Reducing Cpu Usage

Recommended Posts

Hellfire

What are the best ways to reduce the cpu usage the script uses, my script is using 50-70.

It's a big loop that never stops until the script ends.

Share this post


Link to post
Share on other sites
Paulie

What are the best ways to reduce the cpu usage the script uses, my script is using 50-70.

It's a big loop that never stops until the script ends.

Post Script PLZ

Share this post


Link to post
Share on other sites
Lakes

Try Sleep(10) ?


2015 - Still no flying cars, instead blankets with sleeves.

Share this post


Link to post
Share on other sites
SandelPerieanu

Sleep(1)

or

GuiGetMsg()

It's ok!

Share this post


Link to post
Share on other sites
Uten

While 1
  ; I prefere switch for redability, but a test I did once indicated that select  or ofs are faster.
   switch GetGuiMsg()
      case 0
         sleep(250); You should not sleep more as this could cause msg loss
      case else
        ; handel your msg.
   endswitch
  ; I don't think you should place sleep statements here (as quite many do) as this will
  ; Make you sleep between each msg and that could make your app unresponsive when it has
  ; work to do.
Wend

Use the same pattern fro a GetTrayMsg() loop.

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.