aboutsummaryrefslogtreecommitdiff
path: root/externals/ace/Profile_Timer.inl
diff options
context:
space:
mode:
authorXanadu <none@none>2010-07-20 02:49:28 +0200
committerXanadu <none@none>2010-07-20 02:49:28 +0200
commit79622802f397258ee0f34327ba3ae6977ca3e7ff (patch)
tree1868946c234ab9ee256a6b7766a15713eae94235 /externals/ace/Profile_Timer.inl
parent7dd2dc91816ab8b3bc3b99a1b1c99c7ea314d5a8 (diff)
parentf906976837502fa5aa81b982b901d1509f5aa0c4 (diff)
Merge. Revision history for source files should be all back now.
--HG-- branch : trunk rename : sql/CMakeLists.txt => sql/tools/CMakeLists.txt rename : src/server/game/Pools/PoolHandler.cpp => src/server/game/Pools/PoolMgr.cpp rename : src/server/game/Pools/PoolHandler.h => src/server/game/Pools/PoolMgr.h rename : src/server/game/PrecompiledHeaders/NixCorePCH.cpp => src/server/game/PrecompiledHeaders/gamePCH.cpp rename : src/server/game/PrecompiledHeaders/NixCorePCH.h => src/server/game/PrecompiledHeaders/gamePCH.h
Diffstat (limited to 'externals/ace/Profile_Timer.inl')
-rw-r--r--externals/ace/Profile_Timer.inl129
1 files changed, 129 insertions, 0 deletions
diff --git a/externals/ace/Profile_Timer.inl b/externals/ace/Profile_Timer.inl
new file mode 100644
index 00000000000..9990585cef6
--- /dev/null
+++ b/externals/ace/Profile_Timer.inl
@@ -0,0 +1,129 @@
+// -*- C++ -*-
+//
+// $Id: Profile_Timer.inl 80826 2008-03-04 14:51:23Z wotte $
+
+#include "ace/OS_NS_sys_time.h"
+#include "ace/OS_NS_sys_resource.h"
+#include "ace/Global_Macros.h"
+
+#if (defined (ACE_HAS_PRUSAGE_T) || defined (ACE_HAS_GETRUSAGE)) && !defined (ACE_WIN32)
+
+# if defined (ACE_HAS_PRUSAGE_T)
+# include "ace/OS_NS_stropts.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE int
+ACE_Profile_Timer::start (void)
+{
+ ACE_TRACE ("ACE_Profile_Timer::start");
+ return ACE_OS::ioctl (this->proc_handle_,
+ PIOCUSAGE,
+ &this->begin_usage_);
+}
+
+ACE_INLINE int
+ACE_Profile_Timer::stop (void)
+{
+ ACE_TRACE ("ACE_Profile_Timer::stop");
+ this->last_usage_ = this->end_usage_;
+ return ACE_OS::ioctl (this->proc_handle_,
+ PIOCUSAGE,
+ &this->end_usage_);
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+# elif defined (ACE_HAS_GETRUSAGE)
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE int
+ACE_Profile_Timer::start (void)
+{
+ ACE_TRACE ("ACE_Profile_Timer::start");
+ this->begin_time_ = ACE_OS::gettimeofday ();
+ ACE_OS::getrusage (RUSAGE_SELF,
+ &this->begin_usage_);
+ return 0;
+}
+
+ACE_INLINE int
+ACE_Profile_Timer::stop (void)
+{
+ ACE_TRACE ("ACE_Profile_Timer::stop");
+ this->last_time_ = this->end_time_;
+ this->end_time_ = ACE_OS::gettimeofday ();
+ this->last_usage_ = this->end_usage_;
+ ACE_OS::getrusage (RUSAGE_SELF,
+ &this->end_usage_);
+ return 0;
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+# endif /* ACE_HAS_PRUSAGE_T */
+
+#elif defined (ACE_WIN32)
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE
+ACE_Profile_Timer::~ACE_Profile_Timer (void)
+{
+}
+
+ACE_INLINE int
+ACE_Profile_Timer::start (void)
+{
+ ACE_TRACE ("ACE_Profile_Timer::start");
+# if defined (ACE_HAS_GETRUSAGE)
+ ACE_OS::getrusage (RUSAGE_SELF,
+ &this->begin_usage_);
+# endif /* ACE_HAS_GETRUSAGE */
+ this->timer_.start ();
+ return 0;
+}
+
+ACE_INLINE int
+ACE_Profile_Timer::stop (void)
+{
+ ACE_TRACE ("ACE_Profile_Timer::stop");
+ this->timer_.stop ();
+# if defined (ACE_HAS_GETRUSAGE)
+ this->last_usage_ = this->end_usage_;
+ ACE_OS::getrusage (RUSAGE_SELF, &this->end_usage_);
+# endif /* ACE_HAS_GETRUSAGE */
+ return 0;
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#else
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE int
+ACE_Profile_Timer::start (void)
+{
+ ACE_TRACE ("ACE_Profile_Timer::start");
+ this->timer_.start ();
+ return 0;
+}
+
+ACE_INLINE int
+ACE_Profile_Timer::stop (void)
+{
+ ACE_TRACE ("ACE_Profile_Timer::stop");
+ this->timer_.stop ();
+ return 0;
+}
+
+ACE_INLINE
+ACE_Profile_Timer::~ACE_Profile_Timer (void)
+{
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#endif /* defined (ACE_HAS_PRUSAGE_T) || defined (ACE_HAS_GETRUSAGE) */