Changeset 36:c5d92dd968cd in roaraudio


Ignore:
Timestamp:
06/22/08 15:45:40 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

changed latency messurment code a bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/loop.c

    r9 r36  
    99 struct timeval         try, ans; 
    1010 long int ans_1last = 0, ans_2last = 0, ans_3last = 0; 
     11 long int loopc = 0; 
    1112 
    1213 printf("\n\e[s"); 
     
    4748  if ( g_standby ) { 
    4849   usleep((1000000 * ROAR_OUTPUT_BUFFER_SAMPLES) / sa->rate); 
     50   printf("usleep(%li) = ?\n", (1000000 * ROAR_OUTPUT_BUFFER_SAMPLES) / sa->rate); 
    4951  } else { 
    5052   clients_send_filter(sa, pos); 
     
    6567 ans.tv_usec -= try.tv_usec; 
    6668 
    67  if ( pos % 3 ) { 
     69 if ( loopc % 128 ) { 
    6870  printf("\e[ucurrent latency: %.3fms  average: %.3fms   ",  ans.tv_usec                               / (double)1000, 
    6971                                                            (ans.tv_usec+ans_3last+ans_2last+ans_1last)/ (double)4000); 
     
    7476 ans_2last = ans_1last; 
    7577 ans_1last = ans.tv_usec; 
     78 loopc++; 
    7679#endif 
    7780 } 
Note: See TracChangeset for help on using the changeset viewer.