486 Appendix A
Additional Lab Exercises
Optimizing Techniques
Optimizing Techniques
For this lab, you will build a VEE program two different ways and note the
difference in execution speed.
Optimizing Techniques, Step 1
Create a program that sends the range
0 to 710 step 10 through both a
sine function and cosine function. Put the results of the functions on an
X vs.Y display. Use the Timer object to clock how long the program
takes. (Set your default preferences for
Trig Mode to Radians.)
Solution—Optimizing Techniques, Step 1
Figure A-12 shows a solution to step 1.
Figure A-12. Optimizing VEE Programs, Step 1
Optimizing Techniques, Step 2
Clone all of the objects from the first program. Modify the new set to collect
the range into an array. Now, the
sine and cosine functions are run
against an array of points, and only plotted one time. Note the time savings.