This command is used to compute the floating point time interval in seconds from a start time in localtime 16 or 11 format, "YYYY-MM-DD HH:MM:SS[.uuuuuu]". The optional ts_end value defaults to the current time.
The command is part of the Humelib package and can be imported from the namespace humelib.
package require Humelib namespace import -force humelib::* set start [localtime 16] tk_dialog .stopwatch {Timer Running} {Press Ok when done.} info 0 Ok set seconds [tsdiff $start] puts "elapsed time=$seconds"