Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/tcl8.5.2/doc/time.n @ 25

Last change on this file since 25 was 25, checked in by landauf, 17 years ago

added tcl to libs

File size: 1.1 KB
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
15time \- Time the execution of a script
16.SH SYNOPSIS
17\fBtime \fIscript\fR ?\fIcount\fR?
18.BE
19
20.SH DESCRIPTION
21.PP
22This command will call the Tcl interpreter \fIcount\fR
23times to evaluate \fIscript\fR (or once if \fIcount\fR is not
24specified).  It will then return a string of the form
25.CS
26\fB503 microseconds per iteration\fR
27.CE
28which indicates the average amount of time required per iteration,
29in microseconds.
30Time is measured in elapsed time, not CPU time.
31.SH EXAMPLE
32Estimate how long it takes for a simple Tcl \fBfor\fR loop to count to
33a thousand:
34.CS
35time {
36    for {set i 0} {$i<1000} {incr i} {
37        # empty body
38    }
39}
40.CE
41
42.SH "SEE ALSO"
43clock(n)
44
45.SH KEYWORDS
46script, time
Note: See TracBrowser for help on using the repository browser.