summaryrefslogtreecommitdiff
path: root/ace/Profile_Timer.cpp
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-07-14 17:31:33 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-07-14 17:31:33 +0000
commit9c420b2bc7b5752933aa5420cdcc8b007cda4591 (patch)
tree9e6884b6755c66cfb4f43dc7cd565d5ff41f5e8f /ace/Profile_Timer.cpp
parent3814b2bb4def911b631707b7458f330456f19582 (diff)
downloadATCD-9c420b2bc7b5752933aa5420cdcc8b007cda4591.tar.gz
added support for platforms that don't have ACE_HAS_PRUSAGE_T or ACE_HAS_GETRUSAGE.
Diffstat (limited to 'ace/Profile_Timer.cpp')
-rw-r--r--ace/Profile_Timer.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/ace/Profile_Timer.cpp b/ace/Profile_Timer.cpp
index 5ac852427e6..38ac295b749 100644
--- a/ace/Profile_Timer.cpp
+++ b/ace/Profile_Timer.cpp
@@ -4,14 +4,14 @@
#define ACE_BUILD_DLL
#include "ace/Profile_Timer.h"
-#if defined (ACE_HAS_PRUSAGE_T) || defined (ACE_HAS_GETRUSAGE)
-
#if !defined (__ACE_INLINE__)
#include "ace/Profile_Timer.i"
#endif /* __ACE_INLINE__ */
ACE_ALLOC_HOOK_DEFINE(ACE_Profile_Timer)
+#if defined (ACE_HAS_PRUSAGE_T) || defined (ACE_HAS_GETRUSAGE)
+
void
ACE_Profile_Timer::dump (void) const
{
@@ -225,4 +225,29 @@ ACE_Profile_Timer::elapsed_time (ACE_Elapsed_Time &et)
this->compute_times (et);
return 0;
}
+
+#else
+
+ACE_Profile_Timer::ACE_Profile_Timer (void)
+ : timer_ ()
+{
+ ACE_TRACE ("ACE_Profile_Timer::ACE_Profile_Timer");
+}
+
+int
+ACE_Profile_Timer::elapsed_time (ACE_Elapsed_Time &et)
+{
+ ACE_TRACE ("ACE_Profile_Timer::elapsed_time");
+
+ ACE_hrtime_t delta_t; /* nanoseconds */
+ timer_.elapsed_time (delta_t);
+
+ et.real_time = delta_t / 1000000000.0;
+ et.user_time = 0;
+ et.system_time = 0;
+
+ return 0;
+}
+
+
#endif /* defined (ACE_HAS_PRUSAGE_T) || defined (ACE_HAS_GETRUSAGE) */