summaryrefslogtreecommitdiffstats
path: root/tests/langbench/sort.tcl
blob: 9e353ab9d51f0fb665d8769c79a348d0a097bd9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
proc main {} {
	global	argv

	foreach file $argv {
		set f [open $file rb]

		# Takes 2.7 seconds/12.3
		while {[gets $f buf] >= 0} {
			lappend l $buf
		}
		close $f
	}

	# takes 7.9 seconds/12.3
	foreach buf [lsort $l] {
		puts $buf
	}
}
fconfigure stdout -buffering full -translation binary
main