Posted to tcl by dgp at Thu Jul 25 05:14:23 GMT 2013view pretty

% set script {
set f 1e-200
for {set ct $argv} {$ct > 0} {incr ct -1} {
    set f [expr {$f * 1.0000017}]
}
}

set f 1e-200
for {set ct $argv} {$ct > 0} {incr ct -1} {
    set f [expr {$f * 1.0000017}]
}

% set argv 1000
1000
% time $script 100
589.52672 microseconds per iteration
% time $script 1000
526.182627 microseconds per iteration
% proc demo argv $script
% time {demo $argv} 1000
135.619865 microseconds per iteration