Is there a way to find out using programs how much time a Windows program (GUI) like MS Word or Adobe Photoshop took to actually load. I understand loading is a subjective issue. Idea is to find out whether a desktop requires attention or not or whether there is any degradation of performance which a user is facing.
2
Answers
A simple solution I think is this one (powershell):
Set the path to the application. Powershell starts the application. Close the application when loaded.
Then you see the time the application needs to open / close.
The usual Powershell way to time a command or any scriptblock is Measure-Command, for example :
But this will time only the time Powershell took to spin up the new process, not really the time taken by the application to load a new window and all its interface.
Fortunately, the System.Diagnostics.Process object which is output by Start-Process has a property called Responding.
According to this MSDN page , this property tells us if the user interface of the associated process is responding to the system.
So we can do this little script :
The -PassThru allows the command to return a Process object which we store in $WordProcess.
Then , we use the Responding property of this object to check if its user interface is responding.
The DO…Until loop will stop looping as soon as the process is responding.
“Start-Sleep -Milliseconds 1” will give us a precision of one millisecond, which should be good enough for most purposes.