summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2017-03-07 11:38:31 (GMT)
committersebres <sebres@users.sourceforge.net>2017-03-07 11:38:31 (GMT)
commit2c44e4887289d6b17deac377da76d117c1adc051 (patch)
treeb8c55b93576bf35ed957e7d317a816058989b9f1
parent9871b8eb6c3ac265b079b3f84861fad27bf3a6ec (diff)
parentdb083499bfff8aee794512e3da2f0ad2f201f6b0 (diff)
downloadtcl-2c44e4887289d6b17deac377da76d117c1adc051.zip
tcl-2c44e4887289d6b17deac377da76d117c1adc051.tar.gz
tcl-2c44e4887289d6b17deac377da76d117c1adc051.tar.bz2
merge sebres-trunk-timerate
-rw-r--r--generic/tclCmdMZ.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 14ff5f0..b62ccf8 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -4282,6 +4282,13 @@ usage:
if (middle >= stop) {
break;
}
+
+ /* don't calculate threshold by few iterations, because sometimes
+ * first iteration(s) can be too fast (cached, delayed clean up, etc) */
+ if (count < 10) {
+ threshold = 1; continue;
+ }
+
/* average iteration time in microsecs */
threshold = (middle - start) / count;
if (threshold > maxIterTm) {