I would like to measure the computational time of some operations in a trcad script. Is there a way to do this?
This would indeed be interesting. Unfortunately, this is not possible (at least now).
I also wanted to do this in the past and have discussed about it with @gunnar.schulze . He may give you more details about it.
Measuring the operation time of the computation from within a trCAD script is not possible. The reason for that is, that the whole script runs in the processing pipeling of trCAD before the mesh operations are executed. If we assume a simple trCAD function that returns a timestamp, we might want to use this to get timestamps before and after an operation in the script. The difference between these timestamps would not be the time requied for processing the operation but only to register it to the (internal) construction tree that is processed at a later point. (The time for registration is always negligibly short compared to the processing time.)
(For those using a command line version of trCAD (i.e. internal members of trinckle), a version could be created that returns the complete construction tree and the execution times of all construction tree elements.)
That sounds like a very good idea. Would it be possible to get the execution times of construction tree elements in the trcad online editor (maybe in a new version)? This would be some kind of profiling feature enabling script runtime optimization.
That should be possible.