本文整理汇总了C++中ACE_Time_Value::now方法的典型用法代码示例。如果您正苦于以下问题:C++ ACE_Time_Value::now方法的具体用法?C++ ACE_Time_Value::now怎么用?C++ ACE_Time_Value::now使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACE_Time_Value
的用法示例。
在下文中一共展示了ACE_Time_Value::now方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: condition_
int
run_main (int , ACE_TCHAR *[])
{
ACE_START_TEST (ACE_TEXT ("Bug_4055_Regression_Test"));
# if defined (ACE_HAS_THREADS)
int status = 1;
ACE_Thread_Mutex mutex_;
ACE_Condition_Thread_Mutex condition_ (mutex_);
ACE_Condition_Attributes_T<ACE_Monotonic_Time_Policy> monotonic_cond_attr_;
ACE_Condition_Thread_Mutex monotonic_condition_ (mutex_, monotonic_cond_attr_);
if (mutex_.acquire () != 0)
{
ACE_ERROR ((LM_ERROR, "(%P|%t) ERROR: Failed to acquire mutex.\n"));
}
else
{
ACE_Time_Value waittime;
waittime = waittime.now ();
if (test_timer (condition_, waittime))
{
ACE_Time_Value_T<ACE_Monotonic_Time_Policy> monotonic_waittime;
monotonic_waittime = monotonic_waittime.now ();
if (test_timer (monotonic_condition_, monotonic_waittime, true))
status = 0;
}
}
# else
int status = 0;
# endif
ACE_END_TEST;
return status;
}
示例2: do_upcall_excep
void do_upcall_excep (::Messaging::ExceptionHolder * excep )
{
try
{
excep->raise_exception ();
}
catch (CORBA::Exception &)
{
}
ACE_DEBUG ((LM_DEBUG, "exception caught on upcall req\n"));
upcall_end = upcall_end.now ();
}
示例3: catch
int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
CORBA::ORB_var orb_;
int result = 0;
try
{
ACE_DEBUG((LM_INFO,"(%P|%t) START OF CLIENT TEST\n"));
orb_ = CORBA::ORB_init (argc, argv);
if (parse_args (argc, argv) != 0)
return 1;
CORBA::Object_var obj = orb_->resolve_initial_references ("RootPOA");
PortableServer::POA_var root_poa =
PortableServer::POA::_narrow (obj.in());
PortableServer::POAManager_var poa_manager =
root_poa->the_POAManager ();
PortableServer::POA_var poa = root_poa;
poa_manager->activate ();
PortableServer::ServantBase_var cb_serv = new SharedIntfCB;
PortableServer::ObjectId_var oid = root_poa->activate_object (cb_serv.in());
obj = root_poa->id_to_reference (oid.in());
Test_Idl::AMI_SharedIntfHandler_var cb =
Test_Idl::AMI_SharedIntfHandler::_narrow (obj.in());
obj = orb_->string_to_object ("file://server.ior");
intf = Test_Idl::SharedIntf::_narrow(obj.in());
ACE_DEBUG((LM_INFO,"(%P|%t) invoking async upcall.\n"));
upcall_start = upcall_start.now ();
intf->sendc_do_upcall (cb.in());
ACE_DEBUG((LM_INFO,"(%P|%t) invoking ping\n"));
ping_start = ping_start.now ();
intf->ping ();
ACE_DEBUG((LM_INFO,"(%P|%t) sync ping returned\n"));
ping_end = ping_end.now ();
result = (upcall_end > ACE_Time_Value::zero && upcall_end <= ping_end) ? 0 : 1;
intf->farewell ();
intf = Test_Idl::SharedIntf::_nil ();
orb_->destroy ();
ACE_DEBUG ((LM_INFO,"(%P|%t) Client Test %C\n",
(result == 0 ? "succeeded":"failed")));
}
catch (const CORBA::Exception& ex)
{
ex._tao_print_exception ("Error: Exception caught:");
}
return result;
}
示例4: do_upcall
void do_upcall (void)
{
ACE_DEBUG ((LM_DEBUG, "upcall returned\n"));
upcall_end = upcall_end.now ();
}
示例5: ping_excep
void ping_excep (::Messaging::ExceptionHolder * )
{
ACE_DEBUG ((LM_DEBUG, "exception caught on ping req\n"));
ping_end = ping_end.now ();
}
示例6: ping
void ping (void)
{
ACE_DEBUG ((LM_DEBUG, "ping returned\n"));
ping_end = ping_end.now ();
}