Artifacts Associated With Ticket 625454ffff
Ticket change [d31c97e6a0] (rid 113640) by davidw on 2002-10-18 23:13:25:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
[ I hate the brevity of the summary field ] Hi, While running some testing code that I wanted to time, it came up as a requirement that users want to run it not by number of iterations, but by a certain length of time. The idea occurred to me that [time] could take an additional argument - a qualifier stating that iterations is a number of seconds (I suppose you could also use 'minutes' or 'hours' for the additional arg if you wanted). The loop would then run for at least, but not precisely, that amount of time, and return the amount of microseconds per iteration. It would also be possible to script the whole thing, of course. Maybe that's a better course of action? The nice thing about time is that the loop overhead is minimal. Having it coded in C would mean that the results would be comparable to regular [time] results.
- foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "davidw"
- subsystem initialized to: "18. Commands M-Z"
- title initialized to: "new arg to 'time' - iterations in secs"
- type initialized to: "RFE"
Ticket change [48019fa82e] (rid 99809) by dkf on 2003-03-10 04:53:17:
- icomment:
Logged In: YES user_id=79902 One problem with this. How to go about calibrating so that the time-reading code is not called very often, as reading the time is a fairly expensive operation (i.e. at least one syscall.) Techniques that would work well for slow chunks of code will be poor for fast chunks, and vice versa...
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [623e72216a] (rid 92381) by dkf on 2003-03-10 18:12:48:
- icomment:
Logged In: YES user_id=79902 One possible technique is to use exponential growth of numbers of iterations per clock measurement until such time as the uncertainty in the measurement drops low enough for a reasonable estimate in the number of times to run the code to be made (or the total allotted time is exceeded.) The problem with this is that to estimate the uncertainty you need to know the accuracy of the platform's clock... :^/
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Add attachment "cps.tcl" [dd702fbad3] (rid 114669) by dkf on 2009-07-14 17:50:30.
Ticket change [99c97d511f] (rid 110850) by dkf on 2009-07-14 17:50:31:
- icomment:
File Added - 334999: cps.tcl
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [4eb05dd196] (rid 125684) by dkf on 2009-07-14 17:53:19:
- icomment:
I've attached a file that comes from some the TclOO benchmarking suite. It tries *very* hard to get a stable set of performance figures, since it is aimed at timing very fast code (method calls originally). If this (or simple adaptations of it) is suitable for the purposes requested, it's perhaps worth putting in tcllib.
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Later"
- username: "dkf"
- icomment:
Ticket change [4c102d0c6c] (rid 261544) by serhiy.storchaka on 2026-11-13 11:18:45:
- closedate changed to: "2461357.9713335303"
- closer changed to: "serhiy.storchaka"
- icomment:
Implemented as the timerate command (TIP 527): timerate script ?time? runs the script for the given number of milliseconds and calibrates out the measurement overhead. It is available in Tcl 9.0, and as tcl::unsupported::timerate since Tcl 8.6.10.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"