beautypg.com

Speed of execution – Teledyne LeCroy WaveRunner XI SERIES Operator’s Manual User Manual

Page 204

background image

W

AVE

R

UNNER

X

I

S

ERIES

204

WRXi-OM-E Rev C

f

is, using the index only once:

(K)

K)

ns slower than the "internal" calculations, because the scripts are interpreted. This could be serious for

ed on each sample, such as convolution, correlation, and long

You can, however, use one of the following:

On Error Resume Next

followed by some code that may make some attempt to deal with the problem, or at least to allow execution to
continue.

On Error GoTo 0

This cancels On Error Resume Next_

Speed of Execution

To maximize the speed of execution of a script, the most important thing you can do is to minimize the number o
operations that are performed inside loops. Anything done once only is unlikely to be an important source of
delay. Please note that VBS is much slower than the internal computations of the instrument, so do everything
you can to save time, unless time is irrelevant to the application.

Using an array element takes longer than using a single variable. Here is an example:

For K = 1 to Total

If X (K) > X (K - 1) Then

Y = Cos (X (K) ) * Sin (X (K) ) * Sqr (X (K) )

End If

Next

To do the same thing we could also write th

OldXK = X (0)

For K = 1 To Total

XK = X

If XK > OldXK Then

Y = Cos (XK) * Sin (XK) * Sqr (X

OldXK = XK

End If

Next

VBS ru
calculations where many operations are need
digital filters.