Ninety-Fifth Percentile Calculation for Bandwidth

I am trying to calculate the bandwidth of my current internet connection. I am pulling the current input and output transfer rate via snmp. If the argument to the following function is a sorted ascending list of the the some of each input and output sample, is this the right way to calculate 95th percentile?

sub ninetyFifth {
    #Expects Sorted Data
    my $ninetyFifthLine = (@_ * .95) - 1;
    return $_[$ninetyFifthLine];
}

Usually, the value grabbed via SNMP is "total octets sent/received since last interface counter clear", so unless you've post-processed it to get the "data sent during interval", you'll just end up with "data sent during the first 95% of samples". Though you say "transfer rate", so that should be OK (although if it is the same as is displayed on the show interface information on a Cisco router, it's not actual throughput, it's the exponential average of short-period throughputs).

Otherwise, that looks right. You'll probably end up with a different (and lower) answer when using 5-minute intervals than when using 10-second intervals, unless you have uncharacteristically smooth bandwidth usage, but both would be the 95th percentile for the interval in question.