Need help getting a timer value reading

I want to enter the value of the timer tool in Grasshopper into a Python script. I want to use this value for further processing. Is there a way to make the timer value readable by the Panel tool?


Thank you in advance

I found this solution in the old forum.


You could also do something like this:

Thanks a lot. I will try it soon.

NO!!! Using Data Recorder and Mass Addition is an absurd construct. See this recent discussion on the subject:

Here is the model using your latest Python timer ( 191228_GHPython_Timer_01.gh ). It’s a Sun/Earth/Moon model with Starlink satellite constellation added:

starlink_2019Dec28a2
starlink_2019Dec28a.gh (40.8 KB)

1 Like

Wow, you feel very strongly about that @Joseph_Oster. But you are right, if your count is relatively small its not the end of the world, but for large data sets it starts to get very heavy. Tested with 10,000 it processes in 193ms; 100,000 took 2s!

The solution in your link is great! Thanks for sharing.

As a side note, when testing the time for processing the mass addition, I found that it is much better to replace mass addition with List Length…If you did want (for some strange reason) to completely avoid Python or C#.

True, that would be more direct than adding up thousands of ‘1’ values but honestly, the notion of using Data Recorder in this context is ridiculous when all you want is a counter… I did a Python counter that was triggered by the GH timer which seemed like a big improvement over Data Recorder and Mass Addition but ultimately was satisfied with the solution created by @AndersDeleuran cited in previous post.

timer
191228_GHPython_Timer_01.gh (4.5 KB)

1 Like

i just try your result, but there is difference when i make remake that…, it seem like the interval does not affect the program (cannot make fast / slow counting). Is there something spesicific that i have to set?

You’ll need to post your definition, so we know how you changed it from my example.

counter_2020Mar4a
counter_2020Mar4a.gh (7.9 KB)