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 tclconference@googlegroups.com
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 Unified Diffs Show Whitespace Changes Patch

Changes to generic/tclCmdMZ.c.

4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
    #endif

	/* if not calibrate */
	if (!calibrate) {
	    /* minimize influence of measurement overhead */
	    if (overhead > 0) {
		/* estimate the time of overhead (microsecs) */
		Tcl_WideInt curOverhead = overhead * count;
		if (middle > curOverhead) {
		    middle -= curOverhead;
		} else {
		    middle = 1;
		}
	    }
	} else {
	    /* calibration - obtaining new measurement overhead */
	    if (measureOverhead > (double)middle / count) {
		measureOverhead = (double)middle / count;
	    }







|



|







4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
    #endif

	/* if not calibrate */
	if (!calibrate) {
	    /* minimize influence of measurement overhead */
	    if (overhead > 0) {
		/* estimate the time of overhead (microsecs) */
		Tcl_WideUInt curOverhead = overhead * count;
		if (middle > curOverhead) {
		    middle -= curOverhead;
		} else {
		    middle = 0;
		}
	    }
	} else {
	    /* calibration - obtaining new measurement overhead */
	    if (measureOverhead > (double)middle / count) {
		measureOverhead = (double)middle / count;
	    }