summaryrefslogtreecommitdiff
path: root/ace/High_Res_Timer.cpp
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-05-30 02:54:32 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-05-30 02:54:32 +0000
commit2f94f197b9025173b964a80acf2e18f56d9946ef (patch)
tree2c7d867e7ae1ef3701aa283e0dad39efecfcf68c /ace/High_Res_Timer.cpp
parent847a3444d21a842849dff45a825d0dc54c6477f4 (diff)
downloadATCD-2f94f197b9025173b964a80acf2e18f56d9946ef.tar.gz
don't use ACE_HAS_PENTIUM code on Solaris (ACE_HAS_HI_RES_TIMER) because it uses ::gethrtime (). (dump): on Solaris, print 64-bit ints with %llu
Diffstat (limited to 'ace/High_Res_Timer.cpp')
-rw-r--r--ace/High_Res_Timer.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/ace/High_Res_Timer.cpp b/ace/High_Res_Timer.cpp
index 57231620fa5..02218f03516 100644
--- a/ace/High_Res_Timer.cpp
+++ b/ace/High_Res_Timer.cpp
@@ -14,7 +14,7 @@ ACE_ALLOC_HOOK_DEFINE(ACE_High_Res_Timer)
// For Intel platforms, a scale factor is required for
// ACE_OS::gethrtime. We'll still set this to one to prevent division
// by zero errors.
-#if defined (ACE_HAS_PENTIUM)
+#if defined (ACE_HAS_PENTIUM) && !defined (ACE_HAS_HI_RES_TIMER)
# include "ace/Object_Manager.h"
# include "ace/Synch.h"
@@ -82,7 +82,7 @@ ACE_High_Res_Timer::get_registry_scale_factor (void)
ACE_UINT32
ACE_High_Res_Timer::global_scale_factor ()
{
-#if defined (ACE_HAS_PENTIUM) && \
+#if defined (ACE_HAS_PENTIUM) && !defined (ACE_HAS_HI_RES_TIMER) && \
((defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || \
defined (ghs) || defined (__GNUG__))
// Check if the global scale factor needs to be set, and do if so.
@@ -126,7 +126,8 @@ ACE_High_Res_Timer::global_scale_factor ()
ACE_High_Res_Timer::calibrate ();
}
}
-#endif /* ACE_HAS_PENTIUM && ((WIN32 && ! WINCE) || ghs || __GNUG__) */
+#endif /* ACE_HAS_PENTIUM && ! ACE_HAS_HIGH_RES_TIMER &&
+ ((WIN32 && ! WINCE) || ghs || __GNUG__) */
return global_scale_factor_;
}
@@ -199,9 +200,18 @@ ACE_High_Res_Timer::dump (void) const
total_.hi (), total_.lo (),
start_incr_.hi (), start_incr_.lo ()));
#else /* ! ACE_LACKS_LONGLONG_T */
+#if defined (ACE_HAS_STHREADS)
+ // Solaris needs %llu for unsigned long long. Other platforms
+ // might, also. ACE_DEBUG doesn't handle %llu or %lu.
+ ACE_OS::fprintf (stderr,
+ ASYS_TEXT ("start_: %llu; end_: %llu; total_: %llu; "
+ "start_incr_: %llu\n"),
+ start_, end_, total_, start_incr_);
+#else /* ! ACE_HAS_STHREADS */
ACE_DEBUG ((LM_DEBUG,
ASYS_TEXT ("start_: %u; end_: %u; total_: %u; start_incr_: %u\n"),
start_, end_, total_, start_incr_));
+#endif /* ! ACE_HAS_STHREADS */
#endif /* ! ACE_LACKS_LONGLONG_T */
ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
}