diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-10-05 11:47:52 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-10-05 11:53:40 (GMT) |
commit | 502c7d324141fb48a902ef475b4fd2932dc859c5 (patch) | |
tree | 6a748d9a12e2b693727468aa381c8b8bfa3fc72f /src/3rdparty/javascriptcore/JavaScriptCore/jsc.cpp | |
parent | b2ea3433f4a42e367fd0708f0198329754903086 (diff) | |
download | Qt-502c7d324141fb48a902ef475b4fd2932dc859c5.zip Qt-502c7d324141fb48a902ef475b4fd2932dc859c5.tar.gz Qt-502c7d324141fb48a902ef475b4fd2932dc859c5.tar.bz2 |
Updated JavaScriptCore from /home/khansen/dev/qtwebkit to jsc-for-qtscript-4.6-staging-05102009 ( 38c2b17366f24220d9ae0456a7cfe2ac78a9f91c )
Adapt src/script to src/3rdparty/javascriptcore changes
Diffstat (limited to 'src/3rdparty/javascriptcore/JavaScriptCore/jsc.cpp')
-rw-r--r-- | src/3rdparty/javascriptcore/JavaScriptCore/jsc.cpp | 41 |
1 files changed, 6 insertions, 35 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jsc.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/jsc.cpp index 92b1e58..ee4e393 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/jsc.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/jsc.cpp @@ -24,6 +24,7 @@ #include "BytecodeGenerator.h" #include "Completion.h" +#include "CurrentTime.h" #include "InitializeThreading.h" #include "JSArray.h" #include "JSFunction.h" @@ -118,53 +119,23 @@ public: long getElapsedMS(); // call stop() first private: -#if PLATFORM(QT) - uint m_startTime; - uint m_stopTime; -#elif PLATFORM(WIN_OS) - DWORD m_startTime; - DWORD m_stopTime; -#else - // Windows does not have timeval, disabling this class for now (bug 7399) - timeval m_startTime; - timeval m_stopTime; -#endif + double m_startTime; + double m_stopTime; }; void StopWatch::start() { -#if PLATFORM(QT) - QDateTime t = QDateTime::currentDateTime(); - m_startTime = t.toTime_t() * 1000 + t.time().msec(); -#elif PLATFORM(WIN_OS) - m_startTime = timeGetTime(); -#else - gettimeofday(&m_startTime, 0); -#endif + m_startTime = currentTime(); } void StopWatch::stop() { -#if PLATFORM(QT) - QDateTime t = QDateTime::currentDateTime(); - m_stopTime = t.toTime_t() * 1000 + t.time().msec(); -#elif PLATFORM(WIN_OS) - m_stopTime = timeGetTime(); -#else - gettimeofday(&m_stopTime, 0); -#endif + m_stopTime = currentTime(); } long StopWatch::getElapsedMS() { -#if PLATFORM(WIN_OS) || PLATFORM(QT) - return m_stopTime - m_startTime; -#else - timeval elapsedTime; - timersub(&m_stopTime, &m_startTime, &elapsedTime); - - return elapsedTime.tv_sec * 1000 + lroundf(elapsedTime.tv_usec / 1000.0f); -#endif + return static_cast<long>((m_stopTime - m_startTime) * 1000); } class GlobalObject : public JSGlobalObject { |