How long is my script?

Easy with powershell

function DateDiff
{
$Result = $EndDate - $StartDate
$Heure = $Result.Hours 
$Minutes = $Result.Minutes
$Secondes = $Result.Seconds

Write-Host "Durée du script: " -ForegroundColor Yellow -NoNewline
Write-Host $Heure -ForegroundColor green -NoNewline
Write-Host " Heures, " -NoNewline
Write-Host $Minutes -ForegroundColor green -NoNewline
Write-Host " Minutes, " -NoNewline
Write-Host $Secondes -ForegroundColor green -NoNewline
Write-Host " Secondes."
Write-Host ""
}

$StartDate = Get-Date
sleep 10
$EndDate = Get-Date
Datediff