Skip to content

Commit 4def0a2

Browse files
committed
test-performance: added calibration of timerate to minimize influence of the parasitical execution-overhead by extremely fast execution times
1 parent 66ea413 commit 4def0a2

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

win/test-performance.tcl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,19 @@
1919
## set testing defaults:
2020
set ::env(TCL_TZ) :CET
2121

22-
## warm-up (load clock.tcl, system zones, locales, etc.):
22+
# warm-up interpeter compiler env, clock platform-related features,
23+
# calibrate timerate measurement functionality:
24+
puts -nonewline "Calibration ... "; flush stdout
25+
puts "done: [lrange \
26+
[timerate -calibrate {}] \
27+
0 1]"
28+
29+
## warm-up test-related features (load clock.tcl, system zones, locales, etc.):
2330
clock scan "" -gmt 1
2431
clock scan ""
2532
clock scan "" -timezone :CET
2633
clock scan "" -format "" -locale en
34+
clock scan "" -format "" -locale de
2735

2836
## ------------------------------------------
2937

@@ -239,6 +247,11 @@ proc test-scan {{reptime 1000}} {
239247
{clock scan "2009-06-30T18:30:00Z" -format "%Y-%m-%dT%H:%M:%S%z"}
240248
{clock scan "2009-06-30T18:30:00 UTC" -format "%Y-%m-%dT%H:%M:%S %z"}
241249

250+
# Scan : locale date-time (en):
251+
{clock scan "06/30/2009 18:30:15" -format "%x %X" -gmt 1 -locale en}
252+
# Scan : locale date-time (de):
253+
{clock scan "30.06.2009 18:30:15" -format "%x %X" -gmt 1 -locale de}
254+
242255
# Scan : dynamic format (cacheable)
243256
{clock scan "25.11.2015 10:35:55" -format [string trim "%d.%m.%Y %H:%M:%S "] -base 0 -gmt 1}
244257

0 commit comments

Comments
 (0)