time(3tcl)

time3tcl

Time the execution of a script

Usage

time script ?count?


    


    


    

Overview

This command will call the Tcl interpreter count times to evaluate script (or once if count is not specified). It will then return a string of the form

503.2 microseconds per iteration

which indicates the average amount of time required per iteration, in microseconds. Time is measured in elapsed time, not CPU time.

Examples

Estimate how long it takes for a simple Tcl for loop to count to a thousand:

time {
    for {set i 0} {$i<1000} {incr i} {
        # empty body
    }
}

Keywords

script, time

Releases

18 releases since Debian 1.1 (Buzz); the text changed 10 times.

  1. 1.1–1.3
  2. 2.0
  3. 2.1
  4. 2.2–3.0
  5. 3.1
  6. 4.0
  7. 5.0
  8. 6.0
  9. 7
  10. 8–10
  11. 11–13

From tcl8.6-doc 8.6.16+dfsg-1 in Debian 13 (Trixie). Also shipped by tcl9.0-doc. Parsed by carta from the page's man source.