FSCORE-626 Add alternate timing method support for Windows XP and 2003 - must be conditionally compiled(default is original timing)

This commit is contained in:
Jeff Lenk
2010-07-15 08:50:45 -05:00
parent 2a7eca492e
commit 30d2e7fda2
3 changed files with 53 additions and 11 deletions
@@ -235,9 +235,9 @@ SWITCH_STANDARD_API(time_test_function)
}
for (x = 1; x <= max; x++) {
then = switch_time_now();
then = switch_time_ref();
switch_yield(mss);
now = switch_time_now();
now = switch_time_ref();
diff = (int) (now - then);
stream->write_function(stream, "test %d sleep %ld %d\n", x, mss, diff);
total += diff;
@@ -299,17 +299,17 @@ SWITCH_STANDARD_API(timer_test_function)
goto end;
}
start = switch_time_now();
start = switch_time_ref();
for (x = 1; x <= max; x++) {
then = switch_time_now();
then = switch_time_ref();
switch_core_timer_next(&timer);
now = switch_time_now();
now = switch_time_ref();
diff = (int) (now - then);
//stream->write_function(stream, "test %d sleep %ld %d\n", x, mss, diff);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Timer Test: %d sleep %d %d\n", x, mss, diff);
total += diff;
}
end = switch_time_now();
end = switch_time_ref();
switch_yield(250000);