I'm running test of the script which computes it's own duration as ($StopDate-$StartDate).TotalMilliseconds but it uses multitheading. $StartDate time stamp is created before multithread code starts and $StopDate
- after all threads finished. The same algorithm is used by the test-code which runs "& powershell.exe -mta $scriptName". It appeared that INTERNAL duration is TWICE less then those computed by the test-code. Could anybody explain this difference?
Seems I've got: test knows nothing about the script executed and it computes full duration since command was started till command was finished and this time includes milliseconds necessary to start "powersell.exe -mta", run the script and terminate
execution. That is BY CHANCE this duration appeared to be twice as big as a script duration - run the script minutes instead of the seconds, the diffirence would be negligable. Thus I CAN BELEIVE internally computed duration.