Line | |
---|
1 | '\" |
---|
2 | '\" Copyright (c) 1993 The Regents of the University of California. |
---|
3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. |
---|
4 | '\" |
---|
5 | '\" See the file "license.terms" for information on usage and redistribution |
---|
6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
7 | '\" |
---|
8 | '\" RCS: @(#) $Id: time.n,v 1.9 2007/12/13 15:22:33 dgp Exp $ |
---|
9 | '\" |
---|
10 | .so man.macros |
---|
11 | .TH time n "" Tcl "Tcl Built-In Commands" |
---|
12 | .BS |
---|
13 | '\" Note: do not modify the .SH NAME line immediately below! |
---|
14 | .SH NAME |
---|
15 | time \- Time the execution of a script |
---|
16 | .SH SYNOPSIS |
---|
17 | \fBtime \fIscript\fR ?\fIcount\fR? |
---|
18 | .BE |
---|
19 | |
---|
20 | .SH DESCRIPTION |
---|
21 | .PP |
---|
22 | This command will call the Tcl interpreter \fIcount\fR |
---|
23 | times to evaluate \fIscript\fR (or once if \fIcount\fR is not |
---|
24 | specified). It will then return a string of the form |
---|
25 | .CS |
---|
26 | \fB503 microseconds per iteration\fR |
---|
27 | .CE |
---|
28 | which indicates the average amount of time required per iteration, |
---|
29 | in microseconds. |
---|
30 | Time is measured in elapsed time, not CPU time. |
---|
31 | .SH EXAMPLE |
---|
32 | Estimate how long it takes for a simple Tcl \fBfor\fR loop to count to |
---|
33 | a thousand: |
---|
34 | .CS |
---|
35 | time { |
---|
36 | for {set i 0} {$i<1000} {incr i} { |
---|
37 | # empty body |
---|
38 | } |
---|
39 | } |
---|
40 | .CE |
---|
41 | |
---|
42 | .SH "SEE ALSO" |
---|
43 | clock(n) |
---|
44 | |
---|
45 | .SH KEYWORDS |
---|
46 | script, time |
---|
Note: See
TracBrowser
for help on using the repository browser.