Grasshopper

algorithmic modeling for Rhino

Hi, I am curious about the timer behaviour.

Timer causes cpu load even if it is not connected to any script or module.

If the script/GH arrangement gets bigger (no actual solutions running or connected) the cpu usage just by enabling the timer module rises in my case to 20% (in an empty files to 6 or 7%), in many cases this 20% would be quiet precious.

Any solutions out there for this? Or any other module that fires intervals out there?

thx gregor

Views: 415

Replies to This Discussion

The regular timer object that comes with GH?

The timer fires X milliseconds after a solution completes, so if you set a very short interval, it will in fact start a new solution quite often. Especially if the solution is quick because nothing was expired. Every time though it still takes some work to find out the solution wasn't expired, to rebuild the display lists (that always happens after a solution, even a pointless one) and to repaint the Rhino viewports.

Does the CPU usage go down if you increase the interval?

It is about the regular timer object, and yes the usage of the cpu goes down if I increase the interval, thanks for that info. 

So if I understand that right, no matter which GH code I use, as soon as I put a timer into it, it starts checking if the solution is fine after each interval? No matter if it is connected to the solution or not? And it is always the timer asking if the solution has finished and not the solution flow telling it has finished?

In my case it sometimes caused a display freeze, knowing about the behaviour helps to adapt the workflow routine. (like starting the solution first and then enable the timer). Therefor a timer with a boolean toggle would be fine, one output could be the interval and the other the boolean true/false. Is there something like this?

Thanks for helping so quick!

So if I understand that right, no matter which GH code I use, as soon as I put a timer into it, it starts checking if the solution is fine after each interval? No matter if it is connected to the solution or not? And it is always the timer asking if the solution has finished and not the solution flow telling it has finished?

Hmm, looking at the code now it seems the timer doesn't fire when it has no targets. And if I profile it on my machine the processor usage only spikes if the timer is both on and connected to something.

Can you upload a minimal working example that shows the problem?

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service