RosettaCodeData/Task/Time-a-function/PowerShell/time-a-function.ps1
2026-04-30 12:34:36 -04:00

12 lines
220 B
PowerShell

function fun($n){
$res = 0
if($n -gt 0) {
1..$n | foreach{
$a, $b = $_, ($n+$_)
$res += $a + $b
}
}
$res
}
"$((Measure-Command {fun 10000}).TotalSeconds) Seconds"