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 πŸ’–βœ¨