summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2019-05-16 17:49:25 (GMT)
committersebres <sebres@users.sourceforge.net>2019-05-16 17:49:25 (GMT)
commitccc592df50d217757d74cb343d046a92d76860c1 (patch)
tree83d8d643beb85dbf2d15c7b95383e13afe5c5ed8 /tests
parent8094d33e4331c3f61d015b91018908fa6fb60b96 (diff)
downloadtcl-ccc592df50d217757d74cb343d046a92d76860c1.zip
tcl-ccc592df50d217757d74cb343d046a92d76860c1.tar.gz
tcl-ccc592df50d217757d74cb343d046a92d76860c1.tar.bz2
timerate: allow continue from measurement cycle (used for conditional flow control of iterations);
more gentle evaluation behaviour, similar to a cycle now (also avoids extra overhead to set result to interp, etc.); todo: rewrite optimization of INST_DONE using last-instruction pointer or optimization flags for compile of iteration (if sebres's perf-branch gets merged).
Diffstat (limited to 'tests')
-rw-r--r--tests/cmdMZ.test8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/cmdMZ.test b/tests/cmdMZ.test
index 4c4f532..09fff07 100644
--- a/tests/cmdMZ.test
+++ b/tests/cmdMZ.test
@@ -412,6 +412,14 @@ test cmdMZ-6.8 {Tcl_TimeRateObjCmd: allow (conditional) break from timerate} {
[expr {[lindex $m1 4] > 1000}] \
[expr {[lindex $m1 6] < 10}]
} {1 1 1 1}
+test cmdMZ-6.8.1 {Tcl_TimeRateObjCmd: allow (conditional) continue in timerate} {
+ set m1 [timerate {continue; return -code error "unexpected"} 1000 10]
+ list \
+ [expr {[lindex $m1 0] < 1000}] \
+ [expr {[lindex $m1 2] == 10}] \
+ [expr {[lindex $m1 4] > 1000}] \
+ [expr {[lindex $m1 6] < 100}]
+} {1 1 1 1}
test cmdMZ-6.9 {Tcl_TimeRateObjCmd: max count of iterations} {
set m1 [timerate {} 1000 5]; # max-count wins
set m2 [timerate {_nrt_sleep 20} 1 5]; # max-time wins