fixed index error in percentile calculations fixed repeateveryuntil to be deterministc

There was an error in calculating the length of the array for calculating percentile when interval/stop aren't easily divisible. Fixed it so it should work with any (positive) numbers now.

There was another error in the RepeatEveryUntil method, namely there was a race condition between the interval and stop tickers that was causing the final workload that is supposed to occur when time=stop to only execute sometimes. Changed the method so it should always kick off the final iteration now.