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