VMware Cloud Community
TheVMinator
Expert
Expert
Jump to solution

Calculating report run time

Is there a simple way to calculate how long your report takes to run and display it in hours, minutes and seconds?

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

A simple example how you can use the New-Timespan cmdlet

$start = Get-Date

# Your code


$duration = New-TimeSpan -Start $start -End (Get-Date)
$duration.Duration()


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

The New-Timespan cmdlet can hep you with that.

See for example Powershell show elapsed time


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

kunaludapi
Expert
Expert
Jump to solution

I use simple measure-command.

--------------------------------------------------------------- Kunal Udapi Sr. System Architect (Virtualization, Networking And Storage) http://vcloud-lab.com http://kunaludapi.blogspot.com VMWare vExpert 2014, 2015, 2016 If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
LucD
Leadership
Leadership
Jump to solution

A simple example how you can use the New-Timespan cmdlet

$start = Get-Date

# Your code


$duration = New-TimeSpan -Start $start -End (Get-Date)
$duration.Duration()


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
TheVMinator
Expert
Expert
Jump to solution

OK great thanks

Reply
0 Kudos