Name

time — Time the execution of a script.

Synopsis

time script [repetitions]

Description

The time command executes script repetitions times, if repetitions is present, or once if not. It measures the amount of time taken by this execution in milliseconds, and returns it.

Example

set time [time {
    set i 0
    while { < $i 100 } {
	incr $i
    }
} 10]
puts "Time is $time"
	  

Produces:

Time is 6