summaryrefslogtreecommitdiff
path: root/ace/Profile_Timer.cpp
diff options
context:
space:
mode:
authorbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-04-16 13:15:16 +0000
committerbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-04-16 13:15:16 +0000
commit92fcd037cd25b065637d09464d2be454a31c6cff (patch)
treebbf16ba7d83c1386fa491d6861595ed6c84bb8fe /ace/Profile_Timer.cpp
parented47348c4552c23d866189ad1c1e3c62c00a7348 (diff)
downloadATCD-92fcd037cd25b065637d09464d2be454a31c6cff.tar.gz
Integrated a patch to return rusage info with elapsed time.
Diffstat (limited to 'ace/Profile_Timer.cpp')
-rw-r--r--ace/Profile_Timer.cpp10
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;
}