2 #include "ace/High_Res_Timer.h"
3 #include "ace/Get_Opt.h"
4 #include "ace/Throughput_Stats.h"
8 int ACE_TMAIN (int argc
, ACE_TCHAR
* argv
[])
14 //FUZZ: disable check_for_lack_ACE_OS
15 ACE_Get_Opt
getopt (argc
, argv
, ACE_TEXT("h:i:"));
17 while ((c
= getopt ()) != -1)
19 //FUZZ: enable check_for_lack_ACE_OS
23 host
= getopt
.opt_arg ();
27 nsamples
= ACE_OS::atoi (getopt
.opt_arg ());
34 ACE_DEBUG ((LM_DEBUG
, "Usage: client -h host -i iterations\n"));
39 clnt_create (host
, PINGPROG
, PINGVERS
, "tcp");
43 ACE_DEBUG ((LM_DEBUG
, "Cannot create client handle\n"));
47 ACE_Throughput_Stats throughput
;
49 ACE_hrtime_t test_start
= ACE_OS::gethrtime ();
50 for (int i
= 0; i
!= nsamples
; ++i
)
52 ACE_hrtime_t start
= ACE_OS::gethrtime ();
55 (void) ping_1 (&p
, cl
);
57 ACE_hrtime_t end
= ACE_OS::gethrtime ();
59 throughput
.sample (end
- test_start
,
63 ACE_DEBUG ((LM_DEBUG
, "Calibrating high resolution timer . . ."));
64 ACE_High_Res_Timer::global_scale_factor_type gsf
=
65 ACE_High_Res_Timer::global_scale_factor ();
66 ACE_DEBUG ((LM_DEBUG
, " done\n"));
68 throughput
.dump_results ("Client", gsf
);