more optimizationification

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2775 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2006-09-22 02:10:27 +00:00
parent 6c5672b1ef
commit 893c7210a2
4 changed files with 41 additions and 20 deletions
+8 -4
View File
@@ -155,8 +155,12 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod
return SWITCH_STATUS_SUCCESS;
}
/* I cant resist setting this to 10ms, we dont even run anything smaller than 20ms so this is already
twice the granularity we need, we'll change it if we need anything smaller
*/
#define STEP_MS 10
#define STEP_MIC 10000
SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
{
switch_time_t reference = switch_time_now();
@@ -169,13 +173,13 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
globals.RUNNING = 1;
while(globals.RUNNING == 1) {
reference += 1000;
reference += STEP_MIC;
while (switch_time_now() < reference) {
switch_yield(1000);
switch_yield(STEP_MIC);
}
current_ms++;
current_ms += STEP_MS;
for (x = 0; x < MAX_ELEMENTS; x++) {
int i = x, index;