Daniel Willmann wrote:
gettimeofday(&now_tv, NULL);
elapsed = ((now_tv.tv_sec - loss_tv->tv_sec) << 7)
+ ((now_tv.tv_usec - loss_tv->tv_usec) << 7) / 1000000;
I
assume here you're calculating the duration of the measurement period
so far and since you want to have sub-second accuracy you multiply
everything with 128. Why 128?
Is it becasue it simplifies the throughput calculation?
(tbf->meas.dl_bw_octets/elapsed in gprs_rlcmac_dl_bw())
hi daniel,
yes. first i wanted something more accurate than one second, so i
multiplied the elapsed time with 128. 128 bytes are 1024 bits, so it
simplifies the calculation for kbits/s.
if
(elapsed < 128)
return 0;
Is the intention here that the duration of the measurements
is supposed
to be one second? So every second these measurements are printed out and
reset?
after every transmitted downlink frame the gprs_rlcmac_dl_bw() function
is called. if at least one second is elapsed, the throughput of the time
that has been elapsed is printed out. it is just a simple solution
without the requirement for a timer for each TBF.
regards,
andreas