Macro running time is wrong (sometimes)
Posted: Mon Aug 26, 2024 12:01 pm
I am trying to benchmark in a reliable way SOLIDWORKS to compare some modification we perform on assembly components and measure their impact on performance. I am trying to get a macro running time using the timer function before and after I launch a command.
like this pseudocode
Sometimes I noticed the time recorded is just unreliable and could be off even 50+ seconds.
I am testing my VBA macro with a file that takes around 60s to fully load and 120s to generate 4 views in our drawing template.
For the drawing part I am aware that the view rebuild/update works in multithreading so my macro timer is probably going to stop well before the completion of the drawing and it is likely limited to SW main thread, leaving the view generation processes in background.
like this pseudocode
Code: Select all
starttime1 = timer
openfile(filename )
endtime1 = timer - starttime
starttime2 = timer
generatedrawing(filename)
endtime2 = timer - starttime
I am testing my VBA macro with a file that takes around 60s to fully load and 120s to generate 4 views in our drawing template.
For the drawing part I am aware that the view rebuild/update works in multithreading so my macro timer is probably going to stop well before the completion of the drawing and it is likely limited to SW main thread, leaving the view generation processes in background.