/* function to calculate the average returns the average as a gdouble , time base is milli seconds  */
gdouble get_average(const nstime_t *sum, guint32 num)
/* function to calculate the average returns the average as a gdouble , time base is milli seconds  */
gdouble get_average(const nstime_t *sum, guint32 num)
{
	gdouble average;
	if(num > 0) {
		average = (double)sum->secs*1000 + (double)sum->nsecs/1000000;
		average /= num;
	}
	else {
		average = 0;
	}
	return average;
}