TIMECMND Function

Estimates the typical runtime for a given command.

Usage

time = TIMECMND(cmnd[, ...])

Input Parameters

cmnd—String specifying a command to be executed. If cmnd has m input variables, they must be designated with the first m letters of the alphabet. If cmnd has n output variables, they must be designated with the last n letters of the alphabet, e.g., cmnd='math_init', cmnd='z=bytarr(9)', cmnd='z=a+1', cmnd='z=a#b', cmnd='z=min(a eq b,y)'.

Optional Input Parameters

TIMECMND can accept any input variables to the command, separated by commas. The order of the input variables corresponds to alphabetic order in the letters designating the variables in cmnd. For example, TIMECMND('z=a/b',foo,bar) tests foo divided by bar.

Returned Value

time—Estimate for the typical runtime of cmnd.

Keywords

Tmin—Minimum sampling time. Time is average runtime obtained from repeated execution of cmnd for at least Tmin seconds. The default is 0.05 seconds.

Nrun—Minimum number of sample run times. If fewer than Nrun runtimes are obtained during the sampling time Tmin, then sampling continues until Nrun runtimes have been obtained. Nrun defaults to 1.

Discussion

None.

Example

a=RANDOMU(s,80,80)
b=a+1 
PM,TIMECMND('z=a#b',a,b)