diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-03-16 22:12:03 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-03-16 22:12:03 +0000 |
commit | df8b2100900a816fd3426096df9addef7d9df1b2 (patch) | |
tree | bb221d35997d45a0636b1dcf7536f806cda4c04f /ace/Profile_Timer.cpp | |
parent | 50ec082498de161e08c1ba880040e246d7d269ad (diff) | |
download | ATCD-df8b2100900a816fd3426096df9addef7d9df1b2.tar.gz |
use units of microseconds instead of seconds if ACE_LACKS_FLOATING_POINT
Diffstat (limited to 'ace/Profile_Timer.cpp')
-rw-r--r-- | ace/Profile_Timer.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/ace/Profile_Timer.cpp b/ace/Profile_Timer.cpp index 6e4b1df6f80..5576894a9f3 100644 --- a/ace/Profile_Timer.cpp +++ b/ace/Profile_Timer.cpp @@ -241,16 +241,20 @@ ACE_Profile_Timer::elapsed_time (ACE_Elapsed_Time &et) { ACE_TRACE ("ACE_Profile_Timer::elapsed_time"); - ACE_hrtime_t delta_t; /* nanoseconds */ +#if defined (ACE_LACKS_FLOATING_POINT) + ACE_Time_Value delta_t; /* elapsed time will be in microseconds */ timer_.elapsed_time (delta_t); -#if defined (ACE_LACKS_FLOATING_POINT) - // If delta_t isn't large, then et.real_time will be 0. Sorry, no - // floating point. - et.real_time = delta_t / ACE_ONE_SECOND_IN_NSECS; + // Store the time in usecs. + et.real_time = delta_t.sec () * ACE_ONE_SECOND_IN_USECS + + delta_t.usec (); #else /* ! ACE_LACKS_FLOATING_POINT */ + ACE_hrtime_t delta_t; /* nanoseconds */ + timer_.elapsed_time (delta_t); + et.real_time = delta_t / (double) ACE_ONE_SECOND_IN_NSECS; #endif /* ! ACE_LACKS_FLOATING_POINT */ + et.user_time = 0; et.system_time = 0; |