Changeset 5979:b65ee6bec536 in roaraudio for roard
- Timestamp:
- 01/28/14 13:06:34 (10 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/loop.c
r5961 r5979 58 58 while (alive) { 59 59 #if defined(MONITOR_LATENCY) && defined(ROAR_HAVE_GETTIMEOFDAY) 60 gettimeofday(&try, NULL);60 gettimeofday(&try, NULL); 61 61 #endif 62 62 … … 151 151 ROAR_DBG("main_loop(*): current pos: %u", g_pos); 152 152 #if defined(MONITOR_LATENCY) && defined(ROAR_HAVE_GETTIMEOFDAY) 153 gettimeofday(&ans, NULL);153 gettimeofday(&ans, NULL); 154 154 155 while (ans.tv_sec > try.tv_sec) {156 ans.tv_sec--;157 ans.tv_usec += 1000000;158 }159 ans.tv_usec -= try.tv_usec;155 while (ans.tv_sec > try.tv_sec) { 156 ans.tv_sec--; 157 ans.tv_usec += 1000000; 158 } 159 ans.tv_usec -= try.tv_usec; 160 160 161 if ( loopc % 128 ) {162 printf("\e[ucurrent latency: %.3fms average: %.3fms ", ans.tv_usec / (double)1000,163 (ans.tv_usec+ans_3last+ans_2last+ans_1last)/ (double)4000);164 fflush(stdout);165 }161 if ( loopc % 128 ) { 162 printf("\e[ucurrent latency: %.3fms average: %.3fms ", ans.tv_usec / (double)1000, 163 (ans.tv_usec+ans_3last+ans_2last+ans_1last)/ (double)4000); 164 fflush(stdout); 165 } 166 166 167 ans_3last = ans_2last;168 ans_2last = ans_1last;169 ans_1last = ans.tv_usec;167 ans_3last = ans_2last; 168 ans_2last = ans_1last; 169 ans_1last = ans.tv_usec; 170 170 #endif 171 171
Note: See TracChangeset
for help on using the changeset viewer.