Title: [125199] trunk/Source/_javascript_Core
- Revision
- 125199
- Author
- [email protected]
- Date
- 2012-08-09 13:38:56 -0700 (Thu, 09 Aug 2012)
Log Message
[QNX] Implement getCPUTime() for OS(QNX)
https://bugs.webkit.org/show_bug.cgi?id=93516
Patch by Yong Li <[email protected]> on 2012-08-09
Reviewed by George Staikos.
Implement getCPUTime() with CLOCK_THREAD_CPUTIME_ID so it will tell
exactly how long the current thread has spent without being impacted
by other things.
* runtime/TimeoutChecker.cpp:
(JSC::getCPUTime):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (125198 => 125199)
--- trunk/Source/_javascript_Core/ChangeLog 2012-08-09 20:35:13 UTC (rev 125198)
+++ trunk/Source/_javascript_Core/ChangeLog 2012-08-09 20:38:56 UTC (rev 125199)
@@ -1,3 +1,17 @@
+2012-08-09 Yong Li <[email protected]>
+
+ [QNX] Implement getCPUTime() for OS(QNX)
+ https://bugs.webkit.org/show_bug.cgi?id=93516
+
+ Reviewed by George Staikos.
+
+ Implement getCPUTime() with CLOCK_THREAD_CPUTIME_ID so it will tell
+ exactly how long the current thread has spent without being impacted
+ by other things.
+
+ * runtime/TimeoutChecker.cpp:
+ (JSC::getCPUTime):
+
2012-08-08 Shane Stephens <[email protected]>
Compile flag for CSS Hierarchies
Modified: trunk/Source/_javascript_Core/runtime/TimeoutChecker.cpp (125198 => 125199)
--- trunk/Source/_javascript_Core/runtime/TimeoutChecker.cpp 2012-08-09 20:35:13 UTC (rev 125198)
+++ trunk/Source/_javascript_Core/runtime/TimeoutChecker.cpp 2012-08-09 20:38:56 UTC (rev 125199)
@@ -80,6 +80,11 @@
GetThreadTimes(GetCurrentThread(), &creationTime, &exitTime, &kernelTime.fileTime, &userTime.fileTime);
return userTime.fileTimeAsLong / 10000 + kernelTime.fileTimeAsLong / 10000;
+#elif OS(QNX)
+ struct timespec time;
+ if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &time))
+ CRASH();
+ return time.tv_sec * 1000.0 + time.tv_nsec / 1.0e6;
#else
// FIXME: We should return the time the current thread has spent executing.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes