Posted to tcl by de at Thu Jan 26 23:35:29 GMT 2017view raw

  1. proc stack_after_idle {howmuch} {
  2. for {set i 0} {$i < $howmuch} {incr i} {
  3. after idle {
  4. # Do something.
  5. set foo bar
  6. }
  7. }
  8. }
  9.  
  10. foreach howmuch {
  11. 10000
  12. 20000
  13. 40000
  14. 60000
  15. } {
  16. stack_after_idle $howmuch
  17. set start [clock milliseconds]
  18. update
  19. puts "$howmuch: [expr {[clock milliseconds] - $start}]"
  20. }
  21.