/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
class e{constructor(){this._skipInitialSamples=3,this._samples=[.35,.4,.45,.4,.35],this._maxSampleMemory=this._samples.length,this._average=this._computeAverage(),this._standardDeviation=this._computeStandardDeviation()}get average(){return this._average}get standardDeviation(){return this._standardDeviation}addSample(e){this._skipInitialSamples--,this._skipInitialSamples>0||(this._samples.push(e),this._samples.length>this._maxSampleMemory&&this._samples.splice(0,this._samples.length-this._maxSampleMemory),this._average=this._computeAverage(),this._standardDeviation=this._computeStandardDeviation())}getSafeTime(){return this._average+3*this._standardDeviation}_computeAverage(){return this._samples.reduce((e,t)=>e+t,0)/this._samples.length}_computeStandardDeviation(){return Math.sqrt(this._samples.map(e=>t(e-this._average)).reduce((e,t)=>e+t,0)/this._samples.length)}}function t(e){return e*e}export{e as ProcessingTimeEstimate};
