Posted to tcl by miguel at Sun Mar 04 12:58:30 GMT 2007view raw
- # Adapted from Ro's http://paste.tclers.tk/166
- #
- # * the original ran here in 32 secs 8.4.12, 54 secs in 8.5a4
- # * reduced to 1000 iterations: 9 vs 15 secs
- # * replaced [up1timer] with builtin [time]: no change
- # * removed all Tk code, ran this under different patchlevels:
- # 8.3.4 9 seconds
- # 8.4.12 9 seconds
- # 8.4.15 8 seconds
- # 8.5a4 15 seconds
- # 8.5a6 10 seconds
- #
- # Looks ok to me
- #
- puts $tcl_patchLevel
- proc get_countries {} {
- set countries {}
- for {set i 0} {$i < 800} {incr i} {
- set x [clock clicks]_[clock seconds]
- lappend countries alphabetica_$x
- }
- return $countries
- }
- set body {
- set countries {}
- for {set i 0} {$i<1000} {incr i} {
- set x [get_countries]
- foreach el $x {lappend countries $el}
- }
- }
- set time [lindex [time $body] 0]
- puts "**elapsed [expr {$time/1000000}] seconds**"