The clock Command

The clock command eliminates the need to exec date to get the time of day in Tcl. The equivalent is:

clock format [clock seconds]

The format operation takes an optional format string that lets you control the date and time string. There is also clock scan to parse clock values, and clock clicks to get high resolution clock values. The clock command is described on page 173.

Get Practical Programming in Tcl & Tk, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.