Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ralf Fassel Newsgroups: comp.lang.tcl Subject: Re: optional args Date: Tue, 24 Feb 2026 17:24:28 +0100 Lines: 50 Message-ID: References: <10ni7p2$38636$1@dont-email.me> <10nib2c$394up$2@dont-email.me> <10niita$3cclr$1@dont-email.me> <10nk9hv$3t7h4$1@dont-email.me> Mime-Version: 1.0 Content-Type: text/plain X-Trace: individual.net 3NhxPfxIRPuT2uEkW/j0KANnw8KKyBv30/4sykdC8fYFUFN2U= Cancel-Lock: sha1:lj5Kp+u5lvziAhjkpTmLC1nfWdA= sha1:z7366GdPsodjKx6K3aGlzzu89vA= sha256:cpXB9UldM0yHo1Jtftm839KOGOOo1eD9a9QtEjwQaoo= User-Agent: Gnus/5.13 (Gnus v5.13) Xref: csiph.com comp.lang.tcl:55499 * Rich | > | % time [list test1 1 2 ] 10000 | > | 0.60965 microseconds per iteration | >> | > | % time [list test1 1 2 3 4 5 6] 10000 | > | 0.56733 microseconds per iteration | >> | > | % time [list test1 1 2 3 4 5 6 7] 10000 | > | 0.6530900000000001 microseconds per iteration | > | > IME if you repeat the individual tests multiple times, you get even | > bigger variations. So instead of taking a single run and base the | > result on that, repeat at least say 10 times to get an idea. > | Those time runs are already for 10000 repetitions. | The third parameter to [time] is "number of repetitions to perform". Yes, I know. Nevertheless, on my otherwise idle PC: % time [list test1 1 2 3 4 5 6 7] 100000 0.60292 microseconds per iteration % time [list test1 1 2 3 4 5 6 7] 100000 0.56502 microseconds per iteration % time [list test1 1 2 3 4 5 6 7] 100000 0.52475 microseconds per iteration % time [list test1 1 2 3 4 5 6 7] 100000 0.5317 microseconds per iteration % time [list test1 1 2 3 4 5 6 7] 100000 0.4898 microseconds per iteration % time [list test1 1 2 3 4 5 6 7] 100000 0.43831 microseconds per iteration % time [list test1 1 2 3 4 5 6 7] 100000 0.482 microseconds per iteration % time [list test1 1 2 3 4 5 6 7] 100000 0.44397 microseconds per iteration % time [list test1 1 2 3 4 5 6 7] 100000 0.55761 microseconds per iteration % time [list test1 1 2 3 4 5 6 7] 100000 0.51394 microseconds per iteration % time [list test1 1 2 3 4 5 6 7] 100000 0.46066 microseconds per iteration % time [list test1 1 2 3 4 5 6 7] 100000 0.48599 microseconds per iteration % time [list test1 1 2 3 4 5 6 7] 100000 0.45478 microseconds per iteration I.e. min 0.43831, max 0.60292 (delta ~25%). If it comes to *micro*seconds, I think there is no 'accurate' timing this way. R'