diff options
author | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-04-16 13:15:16 +0000 |
---|---|---|
committer | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-04-16 13:15:16 +0000 |
commit | 92fcd037cd25b065637d09464d2be454a31c6cff (patch) | |
tree | bbf16ba7d83c1386fa491d6861595ed6c84bb8fe /ace | |
parent | ed47348c4552c23d866189ad1c1e3c62c00a7348 (diff) | |
download | ATCD-92fcd037cd25b065637d09464d2be454a31c6cff.tar.gz |
Integrated a patch to return rusage info with elapsed time.
Diffstat (limited to 'ace')
-rw-r--r-- | ace/Profile_Timer.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ace/Profile_Timer.cpp b/ace/Profile_Timer.cpp index c99f9282c96..cbff43fe3c8 100644 --- a/ace/Profile_Timer.cpp +++ b/ace/Profile_Timer.cpp @@ -268,8 +268,18 @@ ACE_Profile_Timer::elapsed_time (ACE_Elapsed_Time &et) et.real_time = (__int64) delta_t / (double) ACE_ONE_SECOND_IN_NSECS; +# if defined (ACE_HAS_GETRUSAGE) + ACE_Time_Value atv = ACE_Time_Value (this->end_usage_.ru_utime) + - ACE_Time_Value (this->begin_usage_.ru_utime); + et.user_time = atv.sec () + ((double) atv.usec ()) / ACE_ONE_SECOND_IN_USECS; + + atv = ACE_Time_Value (this->end_usage_.ru_stime) + - ACE_Time_Value (this->begin_usage_.ru_stime); + et.system_time = atv.sec () + ((double) atv.usec ()) / ACE_ONE_SECOND_IN_USECS; +# else /* ACE_HAS_GETRUSAGE */ et.user_time = 0; et.system_time = 0; +# endif /* ACE_HAS_GETRUSAGE */ return 0; } |