Reputation: 4736
Here's a strange one...is there anyway of using powershell to see how long it takes to write a file?
So, if I create a file - can powershell tell me how long it took to create that file (ie 25ms or whatever the number is). Also, if I delete a file can it also tell me the time?
Thanks
Upvotes: 0
Views: 80
Reputation: 12248
Measure-Command can do this for you.
e.g.
Measure-Command { new-item -Path test.txt -ItemType File -Force }
Upvotes: 2
Reputation: 200343
You mean something like this?
$before = Get-Date
# do stuff
$after = Get-Date
echo ($after - $before).TotalMilliseconds
Upvotes: 1