Determing Range of a set of values

I would like to have a function "range(waveName [, x1,x2])" that emulates the mean function, but would return the difference between the highest and lowest values in the specified set.
How about:
Function myRange(inWave,x1,x2)
    Wave inWave
    Variable x1, x2
   
    WaveStats/M=1/Q/R=(x1,x2) inWave
    return V_max-V_min
End
How about:

Function RangeDif(w, x1, x2)
    Wave w
    Variable x1, x2
   
    Variable wMin = WaveMin(w, x1, x2)
    Variable wMax = WaveMax(w, x1, x2)
    Variable dif = wMax - wMin
   
    return dif
End


I'm not sure which would be faster (and I'm not willing to bet a nickel on it!).
Thanks to both!

I was embedding the function into a routine found in the manual "Finding the Mean of Segments of a Wave," using "range" instead of "mean."

It ended up that working with the WaveMax and WaveMin valuations was the easier way to go. I tried to create a value "y_range" separately, but it wasn't taking for whatever reason. Anyway, I got what I needed.