Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
12
Task/Time-a-function/PowerShell/time-a-function.psh
Normal file
12
Task/Time-a-function/PowerShell/time-a-function.psh
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue