You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2007/07/24 17:00:49 UTC
svn commit: r559070 -
/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/Date.cpp
Author: tabish
Date: Tue Jul 24 08:00:46 2007
New Revision: 559070
URL: http://svn.apache.org/viewvc?view=rev&rev=559070
Log:
http://issues.apache.org/activemq/browse/AMQCPP-103
APR'ified Date Class
Modified:
activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/Date.cpp
Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/Date.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/Date.cpp?view=diff&rev=559070&r1=559069&r2=559070
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/Date.cpp (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/Date.cpp Tue Jul 24 08:00:46 2007
@@ -17,17 +17,10 @@
#include <decaf/util/Date.h>
#include <decaf/util/Config.h>
-
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
-#ifdef HAVE_SYS_TIMEB_H
-#include <sys/timeb.h>
-#endif
-
#include <decaf/lang/exceptions/UnsupportedOperationException.h>
+#include <apr_time.h>
+
using namespace std;
using namespace decaf;
using namespace decaf::util;
@@ -35,23 +28,5 @@
////////////////////////////////////////////////////////////////////////////////
long long Date::getCurrentTimeMilliseconds(){
-
-#if defined (HAVE_GETTIMEOFDAY)
- timeval tv;
- gettimeofday (&tv, NULL);
- return (tv.tv_sec * 1000LL) + (tv.tv_usec / 1000LL);
-#elif defined (HAVE_TIME)
- return time (NULL) * 1000LL;
-#elif defined (HAVE_FTIME)
- struct timeb t;
- ftime (&t);
- return (t.time * 1000LL) + t.millitm;
-#else
-
- // This platform doesn't support any of the standard time methods
- // ... should never get here.
- #error "No current time function available on the local platform";
-
-#endif
+ return apr_time_now() / 1000;
}
-