2 #include "ace/Timer_Queue.h"
3 #include "ace/Timer_Heap.h"
4 #include "ace/Timer_Wheel.h"
5 #include "ace/Timer_Hash.h"
6 #include "ace/Timer_List.h"
9 #include "TimerDispatcher.h"
11 int ACE_TMAIN (int, ACE_TCHAR
*[])
13 ACE_Timer_Queue
*timer_queue
;
17 ACE_NEW_RETURN (timer_queue
, ACE_Timer_Heap
, -1);
20 ACE_NEW_RETURN (timer_queue
, ACE_Timer_Hash
, -1);
23 ACE_NEW_RETURN (timer_queue
, ACE_Timer_Wheel
, -1);
26 ACE_NEW_RETURN (timer_queue
, ACE_Timer_List
, -1);
29 // setup the timer queue
30 Timer::instance ()->set (timer_queue
);
34 for (long i
= 0; i
< 10 ; i
++)
36 ACE_Time_Value
const timeout (i
);
38 Timer::instance ()->schedule
41 timer_queue
->gettimeofday () + ACE_Time_Value(5),
44 // Set the timerID state variable of the handler.
45 cb
[i
].setID (timerID
);
47 // Implicitly send the handler it's timer id.
52 Timer::instance ()->wait_for_event ();