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
}
