diff options
author | mcorino <mcorino@users.noreply.github.com> | 2011-12-08 18:35:38 +0000 |
---|---|---|
committer | mcorino <mcorino@users.noreply.github.com> | 2011-12-08 18:35:38 +0000 |
commit | 01eb039cbc2232bb44b589635d11952e656902fa (patch) | |
tree | 1a632c5f5641b72fbdc137866384f49fa5c6442d /ACE/tests/Timer_Queue_Test.cpp | |
parent | bc9acf7697ed3ebf81153735dd29a3bb5a41fc4a (diff) | |
download | ATCD-01eb039cbc2232bb44b589635d11952e656902fa.tar.gz |
merged time policy changes from local branch
Diffstat (limited to 'ACE/tests/Timer_Queue_Test.cpp')
-rw-r--r-- | ACE/tests/Timer_Queue_Test.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/ACE/tests/Timer_Queue_Test.cpp b/ACE/tests/Timer_Queue_Test.cpp index 209ea014356..be9514bc424 100644 --- a/ACE/tests/Timer_Queue_Test.cpp +++ b/ACE/tests/Timer_Queue_Test.cpp @@ -29,10 +29,12 @@ #include "ace/Timer_Wheel.h" #include "ace/Timer_Hash.h" #include "ace/Timer_Queue.h" +#include "ace/Time_Policy.h" #include "ace/Recursive_Thread_Mutex.h" #include "ace/Null_Mutex.h" #include "ace/OS_NS_unistd.h" #include "ace/Containers_T.h" +#include "ace/Event_Handler.h" @@ -326,7 +328,10 @@ test_performance (ACE_Timer_Queue *tq, // Set up a bunch of times TIMER_DISTANCE ms apart. for (i = 0; i < max_iterations; ++i) - times[i] = tq->gettimeofday() + ACE_Time_Value(0, i * TIMER_DISTANCE * 1000); + { + times[i] = (tq->gettimeofday() + + ACE_Time_Value(0, i * TIMER_DISTANCE * 1000)); + } ACE_Time_Value last_time = times[max_iterations-1]; @@ -675,8 +680,10 @@ run_main (int argc, ACE_TCHAR *argv[]) // Timer_Heap without preallocated memory, using high-res time. (void) ACE_High_Res_Timer::global_scale_factor (); - ACE_Timer_Heap *tq_heap = new ACE_Timer_Heap; - tq_heap->gettimeofday (&ACE_High_Res_Timer::gettimeofday_hr); + + ACE_Timer_Heap_Variable_Time_Source *tq_heap = + new ACE_Timer_Heap_Variable_Time_Source; + tq_heap->set_time_policy(&ACE_High_Res_Timer::gettimeofday_hr); ACE_NEW_RETURN (tq_stack, Timer_Queue_Stack (tq_heap, ACE_TEXT ("ACE_Timer_Heap (high-res timer)"), |