all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
7
Task/Time-a-function/Tcl/time-a-function.tcl
Normal file
7
Task/Time-a-function/Tcl/time-a-function.tcl
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
proc sum_n {n} {
|
||||
for {set i 1; set sum 0.0} {$i <= $n} {incr i} {set sum [expr {$sum + $i}]}
|
||||
return [expr {wide($sum)}]
|
||||
}
|
||||
|
||||
puts [time {sum_n 1e6} 100]
|
||||
puts [time {} 100]
|
||||
Loading…
Add table
Add a link
Reference in a new issue