summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore/runtime/TimeoutChecker.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/runtime/TimeoutChecker.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/runtime/TimeoutChecker.cpp')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/TimeoutChecker.cpp25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/TimeoutChecker.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/TimeoutChecker.cpp
index 30ba6e9..2a056c9 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/TimeoutChecker.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/TimeoutChecker.cpp
@@ -35,18 +35,10 @@
#if PLATFORM(DARWIN)
#include <mach/mach.h>
-#endif
-
-#if HAVE(SYS_TIME_H)
-#include <sys/time.h>
-#endif
-
-#if PLATFORM(WIN_OS)
+#elif PLATFORM(WIN_OS)
#include <windows.h>
-#endif
-
-#if PLATFORM(QT)
-#include <QDateTime>
+#else
+#include "CurrentTime.h"
#endif
using namespace std;
@@ -75,14 +67,6 @@ static inline unsigned getCPUTime()
time += info.system_time.seconds * 1000 + info.system_time.microseconds / 1000;
return time;
-#elif HAVE(SYS_TIME_H)
- // FIXME: This should probably use getrusage with the RUSAGE_THREAD flag.
- struct timeval tv;
- gettimeofday(&tv, 0);
- return tv.tv_sec * 1000 + tv.tv_usec / 1000;
-#elif PLATFORM(QT)
- QDateTime t = QDateTime::currentDateTime();
- return t.toTime_t() * 1000 + t.time().msec();
#elif PLATFORM(WIN_OS)
union {
FILETIME fileTime;
@@ -97,7 +81,8 @@ static inline unsigned getCPUTime()
return userTime.fileTimeAsLong / 10000 + kernelTime.fileTimeAsLong / 10000;
#else
-#error Platform does not have getCurrentTime function
+ // FIXME: We should return the time the current thread has spent executing.
+ return currentTime() * 1000;
#endif
}