How to output the solution solve time as a value shown in a panel

I have been trying to figure this out for days but have had no luck. I have a foot mesh that I input, run through my script, and then output a personalised shoe. I use the animate button on a slider to iterate over the different foot meshes to test if they successfully produce shoes. I am now trying to evaluate computation time and output this to a csv. I am trying to get the value of the solve time that is usually displayed in the bottom left, but would like it so I can display it in a panel (so it can become an input into the CSV I create).

It feels like this should be quite easy, but I’ve been struggling quite a bit. I tried scripting it in Python using GH_SolutionEventArgs.Duration, but it only tells me the propetry type in IronPython rather than the value itself. Any help on this or if anyone has something they’ve used before (and can please explain how it works) would be really appreciated, thank you!

TL;DR
Please help me display solution solve time (the one that is usually displayed bottom left) in a panel. Thank you!

Bump

it’s a TimeSpan so you can get a value like so:
GH_SolutionEventArgs.Duration.TotalMilliseconds

Thanks for the response Will

I tried it but it states that the getset_descriptor has no attribute of ‘TotalMilliseconds’

It’s not static, meaning not something to be called straight from the library.
You’ll need to access this event args when actually handling the SolutionEnd event

1 Like

oh wait i think this may help:
ApiDocs.co · Grasshopper · GH_Document.SolutionSpan Property

again not static so you need to find the actual active document and call this on that.

How do you cause it to trigger when the document finishes solving?
and how do you reference the active document (is that similar to rh.RhinoDoc.ActiveDoc?)

Really appreciate the help

Bump :confused: