Jump to content

Which one eats less cpu %


pokerialkku

Recommended Posts

Yo, yeah. i would like to use the singlefilter since it would make my code whole lotta cleaner but does it eat more cpu? im noob :d ty

RS2Widget w = widgets.singleFilter(widgets.getAll(), f -> f.isVisible() && f.getMessage().equals("ok") && f.getTextColor() == 138573512);
if (w != null)
	interact();

VS

RS2Widget w = widgets.getWidgetContainingText("ok");
if (w != null && w.isVisible() && w.getTextColor() == 15837581)
	interact();

 

Link to comment
Share on other sites

I believe both would require roughly the same amount since I think they would both have to loop through all the active widgets to retrieve the correct one. Also once you have searched once for the widget you can than reuse that variable instead of searching for the widget again. That way you will only have to run that code once.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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