1 #include "ace/OS_main.h"
2 #include "ace/Profile_Timer.h"
3 #include "ace/Log_Msg.h"
4 #include "ace/OS_NS_stdlib.h"
5 #include "ace/OS_NS_unistd.h"
8 static const int DEFAULT_ITERATIONS
= 100000000;
11 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
13 ACE_Profile_Timer timer
;
14 int iterations
= argc
> 1 ? ACE_OS::atoi (argv
[1]) : DEFAULT_ITERATIONS
;
18 for (int i
= 0; i
< iterations
; i
++)
23 ACE_Profile_Timer::ACE_Elapsed_Time et
;
25 timer
.elapsed_time (et
);
27 ACE_DEBUG ((LM_DEBUG
, "iterations = %d\n", iterations
));
28 ACE_DEBUG ((LM_DEBUG
, "real time = %f secs, user time = %f secs, system time = %f secs\n",
29 et
.real_time
, et
.user_time
, et
.system_time
));
31 ACE_DEBUG ((LM_DEBUG
, "time per call = %f usecs\n",
32 (et
.real_time
/ double (iterations
)) * 1000000));