Tcl Source Code

Check-in [cde1464889]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:fixes estimated time of too short execution considering calibrated overhead (it is 0us and not 1us, example: `timerate {break}` with and without calibration)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sebres-8-5-timerate
Files: files | file ages | folders
SHA3-256: cde1464889ccde72863c230892730d84d422e2d30192fd27dbffdb6e37dea8d6
User & Date: sergey.brester 2019-02-12 19:46:29
Context
2019-02-12
20:37
few test cases for timerate command check-in: e7400f99d5 user: sergey.brester tags: sebres-8-5-timerate
19:46
fixes estimated time of too short execution considering calibrated overhead (it is 0us and not 1us, ... check-in: cde1464889 user: sergey.brester tags: sebres-8-5-timerate
19:38
timerate: allow break from measurement cycle (usable to provide conditional stop possibility inside ... check-in: 11760d10b0 user: sergey.brester tags: sebres-8-5-timerate
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to generic/tclCmdMZ.c.

  4239   4239       #endif
  4240   4240   
  4241   4241   	/* if not calibrate */
  4242   4242   	if (!calibrate) {
  4243   4243   	    /* minimize influence of measurement overhead */
  4244   4244   	    if (overhead > 0) {
  4245   4245   		/* estimate the time of overhead (microsecs) */
  4246         -		Tcl_WideInt curOverhead = overhead * count;
         4246  +		Tcl_WideUInt curOverhead = overhead * count;
  4247   4247   		if (middle > curOverhead) {
  4248   4248   		    middle -= curOverhead;
  4249   4249   		} else {
  4250         -		    middle = 1;
         4250  +		    middle = 0;
  4251   4251   		}
  4252   4252   	    }
  4253   4253   	} else {
  4254   4254   	    /* calibration - obtaining new measurement overhead */
  4255   4255   	    if (measureOverhead > (double)middle / count) {
  4256   4256   		measureOverhead = (double)middle / count;
  4257   4257   	    }