- Performance Tools
- Performance Hints
In a stock tcl binary, you can use the time
command
to measure the execution time of a command. The
format of the command is: time
tcl_command optional_repetition_count. For example:
% time {foreach i [list a b c d e ] { lappend result $i}}
808 microseconds per iteration
% time {foreach i [list a b c d e ] { lappend result $i}} 10
259 microseconds per iteration
% time {foreach i [list a b c d e ] { lappend result $i}} 100
244 microseconds per iteration
The TclX package includes a profile
command which can be
used to return a call stack. TclX can be found at ftp://ftp.neosoft.com/pub/tcl/tclx-distrib
.
Tycho uses profile
to provide a Graphical
Tcl Profiler.
The hints below were taken from Practical
Programming in Tcl and Tk, by
Brent B. Welch, page 87.
Tycho Home Page
Copyright © 1996, The Regents of the University of California.
All rights reserved.
Last updated: 96/09/03,
comments to: eal@eecs.berkeley.edu