summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore/jsc.cpp
diff options
context:
space:
mode:
authorJani Hautakangas <ext-jani.hautakangas@nokia.com>2009-09-29 10:49:57 (GMT)
committerJani Hautakangas <ext-jani.hautakangas@nokia.com>2009-09-29 10:49:57 (GMT)
commitcc910f05b560bf561b45e7d726ffd82f3eb28a7b (patch)
tree3be96de0b4174cf03a7e4a45d96866d7c2f0d7b7 /src/3rdparty/webkit/JavaScriptCore/jsc.cpp
parent9a7ca912ce72476bda57f2306b38e5f6e928fbf5 (diff)
parent8fe49324d8b58eb1c0945259da00905cca02822c (diff)
downloadQt-cc910f05b560bf561b45e7d726ffd82f3eb28a7b.zip
Qt-cc910f05b560bf561b45e7d726ffd82f3eb28a7b.tar.gz
Qt-cc910f05b560bf561b45e7d726ffd82f3eb28a7b.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/jsc.cpp')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/jsc.cpp41
1 files changed, 6 insertions, 35 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/jsc.cpp b/src/3rdparty/webkit/JavaScriptCore/jsc.cpp
index 92b1e58..ee4e393 100644
--- a/src/3rdparty/webkit/JavaScriptCore/jsc.cpp
+++ b/src/3rdparty/webkit/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 {