Sign in to follow this  
Followers 0
Hellfire

Reducing Cpu Usage

5 posts in this topic

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



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

Try Sleep(10) ?


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

Share this post


Link to post
Share on other sites

Sleep(1)

or

GuiGetMsg()

It's ok!

Share this post


Link to post
Share on other sites

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  
Followers 0