time(3tcl)
β¨ time β the manual, bestie edition β¨
okay so this is time(3tcl) from the Tcl Built-In Commands crew π
she's short, she's sweet, she's literally the stopwatch of your Tcl era π
π NAME π
time β she times the execution of a script β±οΈβ¨
πΈ SYNOPSIS πΈ
time script ?count?
π¦ DESCRIPTION π¦
okay so here's the tea π« β this command calls the Tcl interpreter count times to evaluate script. and if you didn't give her a count? she just does it once, nbd π
then she hands you back a string that looks exactly like this:
503.2 microseconds per iteration
and that lil string is telling you the average amount of time each iteration needed, measured in microseconds β
lowkey important: time here is measured in elapsed time, not CPU time π like, it's the wall-clock vibe, the real "how long did this actually take" energy, not how much processor juice got sipped π§
π EXAMPLE π
say you wanna estimate how long it takes for a simple Tcl for loop to count to a thousand β iconic curiosity, love that for you π:
time {
for {set i 0} {$i<1000} {incr i} {
# empty body
}
}
π SEE ALSO π
π KEYWORDS π
script, time
and that's the whole page, fr fr π go forth and benchmark your little scripts, main character π§
source/version: this one's from Tcl (time(3tcl)) β mwah, slay, periodt πβ¨
π¦ where this page comes from
- debian bookworm: tcl8.6-doc 8.6.13+dfsg-2
- debian trixie: tcl8.6-doc 8.6.16+dfsg-1
- debian trixie: tcl9.0-doc 9.0.1+dfsg-2
- ubuntu jammy: tcl8.6-doc 8.6.12+dfsg-1build1
- ubuntu noble: tcl8.6-doc 8.6.14+dfsg-1build1
- ubuntu questing: tcl8.6-doc 8.6.17+dfsg-1
- ubuntu questing: tcl9.0-doc 9.0.2+dfsg-1
- ubuntu resolute: tcl8.6-doc 8.6.17+dfsg-1build1
- ubuntu resolute: tcl9.0-doc 9.0.3+dfsg-1
- ubuntu stonking: tcl8.6-doc 8.6.18+dfsg-1
- ubuntu stonking: tcl9.0-doc 9.0.4+dfsg-1
- Copyright (c) 1993 The Regents of the University of California
- Copyright (c) 1994-1996 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms