Tk Library Source Code

Artifact [ebb912f476]
Login

Artifact ebb912f47649aedfa60840c593b1c253242eb632:

Attachment "lbs.tcl" to ticket [1472443fff] added by jepler 2006-04-18 23:23:17.
package require BWidget

proc t n {
    set t0 [clock clicks -milliseconds]
    destroy .l
    pack [ListBox .l -multicolumn 1]

    for {set i 0} {$i < $n} {incr i} {
        .l insert end $i -data $i -text $i
    }
    update
    set t1 [clock clicks -milliseconds]
    expr {$t1-$t0}
}

wm dei .

for {set i 1000} {$i < 20000} {incr i $i} {
    set t [t $i]
    puts [format "%10d %8d %8.3f" $i $t [expr {$t*1.0/$i}]]
    after 100
}