Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Bug_2734_Regression / test_i.cpp
blob829ad2298e36324abfe1c3cfff1a51eebc81a9fc
1 #include "test_i.h"
2 #include "ace/OS_NS_unistd.h"
3 #include "ace/High_Res_Timer.h"
5 ACE_High_Res_Timer sleep_duration;
8 Simple_Server_i::Simple_Server_i (CORBA::ORB_ptr orb)
9 : orb_ (CORBA::ORB::_duplicate (orb))
11 sleep_duration.calibrate();
14 CORBA::Long
15 Simple_Server_i::echo (CORBA::Long x,
16 CORBA::Long msecs)
18 ACE_Time_Value tv (msecs / 1000, (msecs % 1000) * 1000);
20 ACE_DEBUG ((LM_DEBUG, "server (%P) will request sleep for %d sec and %d msecs.\n",
21 tv.sec(), tv.msec ()));
23 sleep_duration.reset();
24 sleep_duration.start();
25 ACE_OS::sleep (tv);
26 sleep_duration.stop();
27 ACE_hrtime_t usec;
28 sleep_duration.elapsed_microseconds(usec);
29 ACE_DEBUG ((LM_DEBUG, "server (%P) actually slept for %d sec and %d msecs.\n",
30 usec/1000000, (usec % 1000000)/1000));
32 return x;
35 void
36 Simple_Server_i::shutdown (void)
38 ACE_DEBUG ((LM_DEBUG,
39 "server (%P) Received shutdown request from client\n"));
40 this->orb_->shutdown (0);