1#! /usr/local/bin/wish
2
3proc drawlines {} {
4    puts [clock format [clock seconds]]
5
6    for {set j 0} {$j < 100} {incr j} {
7	puts -nonewline "*"
8	flush stdout
9	if {$j & 1} {
10	    set c "blue"
11	} {
12	    set c "red"
13	}
14	for {set i 0} {$i < 100} {incr i} {
15#	    .a create line $i 0 0 [expr 500 - $i] -fill $c
16	}
17    }
18
19    puts [clock format [clock seconds]]
20
21    for {set j 0} {$j < 100} {incr j} {
22	puts -nonewline "*"
23	flush stdout
24	if {$j & 1} {
25	    set c "blue"
26	} {
27	    set c "red"
28	}
29	for {set i 0} {$i < 100} {incr i} {
30	    .a create line $i 0 0 [expr 500 - $i] -fill $c
31	}
32    }
33
34    puts [clock format [clock seconds]]
35#    destroy .
36}
37
38canvas .a -height 500 -width 500
39button .b -text draw -command drawlines
40pack .a .b -side left
41
42# eof
43