Retroactively finding out timelength for a Boolean

Simply put - is there a way to find out how long a specific boolean operation took? I started a complex one before I went home from work to go overnight, and when I got back it was finished. However, I now want to do a similarly complex one and am wondering if it is worth doing now, or if its another one to leave overnight.

The easiest way to do this would be by using a python script.

What sort of objects are you performing the boolean on? Are they meshes, surfaces…? What boolean operation?

Here is an example:

import rhinoscriptsyntax as rs
import time

#select the relevant objects
ObjectA=rs.GetObject("Select the first object",8|16) #filter for surfaces and polysurfaces
ObjectB=rs.GetObject("Select the second object",8|16) #filter for surfaces and polysurfaces

StartTime=time.time()
rs.BooleanUnion((ObjectA,ObjectB)) #perform boolean operation
EndTime=time.time()

Time=round(EndTime-StartTime,3) 

print "The boolean operation took " + str(Time) + " Seconds"

Type “_EditPythonScript” into the command line then copy and past the above into a new empty script.

This will work on surfaces and polysurfaces. If you are using meshes then you will have to change the filters on rs.GetObject and use rs.MeshBooleanUnion. If you are using a different boolean operation then you will have to adjust the script accordingly. the help file is your friend!

I should add that this will only help you for future operations. I don’t think you can get this information retroactively.

I wonder if [F2] calling up the command window might show the elapsed time. It’s a pretty ‘deep’ ledger.

Nope, the command window doesn’t use time stamps,

@pascal An option to have a subtle timestamp in the command line, or even just in CommandHistory, would be helpful sometimes.

1 Like

Hi Greg- how so, in general? I understand BeeCee’s immediate need, but that seems better handled by a script or something since it would seem (to me) to be a relatively rare need - can you give me examples of where this would be useful? I don’t say it isn’t, I just don’t see it, off hand.

thanks,

-Pascal

I rather often end up running commands that take a long time to process. As in @BeeCee’s situation, it’s helpful to know for future similar commands. Or also to compare between speeds of different methods operations. I guess the next timestamp would need to display after a command is completed.

Obviously not an urgent/dire request, just could be nice occasionally.

Grasshopper has a nice “Solution completed in _ seconds/minutes ( _ seconds/minutes ago)” status bar line for a similar purpose, aside from the more detailed profiler widget. I just wish the “completed…” status didn’t disappear eventually, like waiting until something else is changed/run.

Also, it could be used as a time-tracking tool for a job, though I realize there are other tools for this…

Actually when I brought this up this morning, I was specifically thinking of Grasshopper’s status bar line as well. Something in the command line records that might automatically give a record of the time a very large operation took.

As an update, this was for an extremely complex polysurface that had been separated by a boolean split, shifted slightly, then tried to boolean-join together later (I was aware that it would be a very timely operation due to the amount of co-planar faces). Would have been great to know if it would have run over a lunch hour, or if it needs a full night to run (which I assume would have taken roughly the same amount of time as the previous night’s operation).

I ended up aborting Rhino, restarting and doing all the trimming by hand; took about an hour or so,