Internalize Timer in C# - Simple Counter

Thank you very much. I don’t understand this part of the code because I’m lazy about digging too deeply into scripting. Will give it a try though. (see below)

# Define callback action
def callBack(e):
    ghenv.Component.ExpireSolution(False)
    
# Get grasshopper document
ghDoc = ghenv.Component.OnPingDocument()

# Schedule this component to expire
ghDoc.ScheduleSolution(interval,gh.Kernel.GH_Document.GH_ScheduleDelegate(callBack)) 

Later… 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)

There are two timers, in orange groups, one for Earth/Moon and the other for the satellites. The first thing I notice is that the satellites slow down when the Earth/Moon timer is enabled. I checked and found the same thing is true using two Timer components with Python counters in yesterday’s version: starlink_2019Dec27a.gh (33.4 KB)

Driving two Python counters with a single Timer doesn’t seem to help so maybe the model is just more compute-intensive with both parts moving?

Evolved from a much simpler question in this thread:

P.S. This topic goes way back: May 8, 2015

P.P.S. Here is a version with two Python counters driven by a single Timer:
starlink_2019Dec27b.gh (36.9 KB)