how to calculate "moving average" : can be used to get good ping average average = firstdata; //init with first data //then a=0.125; //adjust this to slow down/speedup average = (1-a)*average + a*nextdata;