I'm writing a program that performs certain optimizations on an executable file and am looking for a way to measure the time the executable took to run.
I've been using a script that measures the start time and end time, but this doesn't take into account that the process might not be running all the time (due to OS resource allocation).
Will the PowerShell command 'Measure-Command' give me a more precise response? And will 'Time' do the same on Linux?
If not, how should I go about doing so? (A command line solution is preferable.)