Basics of the MKS Toolkit - Mks.com
Basics of the MKS Toolkit - Mks.com
Basics of the MKS Toolkit - Mks.com
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Timing Programs<br />
Timing Programs<br />
The time <strong>com</strong>mand built into <strong>the</strong> <strong>MKS</strong> KornShell lets you time<br />
programs to find out how much processor time <strong>the</strong>y actually require.<br />
You might use this to <strong>com</strong>pare two versions <strong>of</strong> a program to see if one<br />
runs faster than <strong>the</strong> o<strong>the</strong>r. From a <strong>MKS</strong> KornShell prompt, you can<br />
run a program with<br />
time <strong>com</strong>mand-line<br />
Creating Symbol Tables<br />
where <strong>com</strong>mand-line is a <strong>com</strong>mand line that invokes <strong>the</strong> program you<br />
want to time. time runs <strong>the</strong> program, <strong>the</strong>n displays:<br />
<strong>the</strong> total time taken by <strong>the</strong> program;<br />
<strong>the</strong> time spent in <strong>the</strong> operating system (using system service<br />
calls);<br />
<strong>the</strong> time spent in <strong>the</strong> user program's own code.<br />
A number <strong>of</strong> <strong>MKS</strong> <strong>Toolkit</strong> <strong>com</strong>mands work with executable files that<br />
contain <strong>the</strong>ir own symbol tables. The symbol table format may be <strong>the</strong><br />
one used by <strong>the</strong> Codeview Symbols <strong>of</strong> Micros<strong>of</strong>t C.<br />
Of course, many popular <strong>com</strong>pilers and/or linkers do not use this<br />
format. In particular, versions <strong>of</strong> <strong>the</strong> Micros<strong>of</strong>t link <strong>com</strong>mand do not<br />
even store symbol tables in <strong>the</strong> executable file. Instead, link prepares<br />
a (text) file describing <strong>the</strong> symbol table (provided that you specify an<br />
option asking for such a file). By default, <strong>the</strong> file extension <strong>of</strong> this<br />
`symbol table file' is .map.<br />
Codeview symbol tables can be removed from an executable file with<br />
<strong>the</strong> <strong>Toolkit</strong>'s strip <strong>com</strong>mand, as in<br />
strip file.exe<br />
<strong>Basics</strong> <strong>of</strong> <strong>the</strong> <strong>MKS</strong> <strong>Toolkit</strong> 29