_____ _ ___ _ _ __ __ _
|_ _|_| |/ __| |___ __| |_| \/ |___ __| |
| |/ _| | (__| / _ \/ _| / / |\/| / _ \/ _` |
|_|\__|_|\___|_\___/\__|_\_\_| |_\___/\__,_|
v.8.6.7-03 2018/12/03
This is the source distribution of the Tcl clock extension: the faster Tcl-module for the replacement of the standard "clock" ensemble of tcl.
You need to have your Tcl core compiled also.
This extension is a freely available open source package. You can do virtually anything you like with it, such as modifying it, redistributing it, and selling it either in whole or in part. See the "license.terms" file in the top-level distribution directory for complete information.
Only Unix-like and Windows platforms are supported at the moment. Depending on your platform (Unix-like or Windows) go to the appropriate directory (unix or win) and start with the README file. Macintosh platform is supported similar way the Tcl core does it also.
package require tclclockmod
clock format -now
Current performance increase (in comparison vs the tcl-core clock):
Function | Performance increase | tclclockmod | tcl8.6-clock |
---|---|---|---|
clock format |
15 - 20 times faster | 0.27 - 4.28 µs/# | 5.45 - 45 µs/# |
clock scan -format |
40 - 70 times (up to 100 times faster *) * some previously extremely slow scans |
0.44 - 1.72 µs/# | 21 - 120 µs/# |
clock scan (freescan) |
15 - 20 times | 0.51 - 5.84 µs/# | 12 - 77 µs/# |
clock add |
50 - 90 times | 0.31 - 0.68 µs/# | 15 - 45 µs/# |
The difference is much more larger, if the tests are running multi-threaded with parasitic load.
Although this clock-ensemble version is almost 100% compatible (except of some changes of the logic as regards the bug-fixing), but you should nevertheless test it with your application.
The module is currently usable with latest Tcl 8.6th version (>= 8.6.6), but can be used also with previous versions since 8.6.0 (note that some packages like "msgcat" should be upgraded in this case).
Same as "clock scan" except:
- If the -timezone argument is an empty string, it uses timezone UTC
- If the input string is an integer, it assumes it's already a UNIX epoch timestamp and returns it unchanged
- If the input sting is not a valid time, it returns 0 rather than generating an error
Use github issue-tracker.
send kudos to the original author (Sergey G. Brester).
- FlightAware for the inspiration for me to write it (due to their bounty-program).
- TCT and all other contributors for the great language (long live Tcl!).
See the file "license.terms" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.