What version of tclsh are you running from the command line? Is it also 8.3.2? Also, if you use the tcl command
time command, you can get better granularity than
exec'ing date.
Using a modified version of your test:
time {
set counter 0
while { $counter < 1000000 } {
incr counter
}
} 10
and inside a proc:
proc time_loop_speed {} {
time {
set counter 0
while { $counter < 1000000 } {
incr counter
}
} 10
}
I got the following results (P3-500, RH 6.2):
| inline | proc |
tclsh 8.3.2 | 3309115 ms per iteration | 2934595 ms per iteration |
AOLserver 3.2+ad12, nsd8x | 6607447 ms per iteration | 5637806 ms per iteration |
Of course, it's not really an apples-to-apples comparison because tclsh is not threaded, while nsd8x is.