Commit c9a2c253 authored by eric@webkit.org's avatar eric@webkit.org

2010-01-27 Kwang Yul Seo <skyul@company100.net>

        Reviewed by Eric Seidel.

        [BREWMP] Port getCPUTime
        https://bugs.webkit.org/show_bug.cgi?id=33572

        Use GETUPTIMEMS which returns a continuously and
        linearly increasing millisecond timer from the time the device
        was powered on. This function is enough to implement getCPUTime.

        * runtime/TimeoutChecker.cpp:
        (JSC::getCPUTime):

git-svn-id: svn://svn.chromium.org/blink/trunk@53926 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 0d5b3383
2010-01-27 Kwang Yul Seo <skyul@company100.net>
Reviewed by Eric Seidel.
[BREWMP] Port getCPUTime
https://bugs.webkit.org/show_bug.cgi?id=33572
Use GETUPTIMEMS which returns a continuously and
linearly increasing millisecond timer from the time the device
was powered on. This function is enough to implement getCPUTime.
* runtime/TimeoutChecker.cpp:
(JSC::getCPUTime):
2010-01-27 Kwang Yul Seo <skyul@company100.net> 2010-01-27 Kwang Yul Seo <skyul@company100.net>
Reviewed by Oliver Hunt. Reviewed by Oliver Hunt.
......
...@@ -41,6 +41,10 @@ ...@@ -41,6 +41,10 @@
#include "CurrentTime.h" #include "CurrentTime.h"
#endif #endif
#if PLATFORM(BREWMP)
#include <AEEStdLib.h>
#endif
using namespace std; using namespace std;
namespace JSC { namespace JSC {
...@@ -80,6 +84,11 @@ static inline unsigned getCPUTime() ...@@ -80,6 +84,11 @@ static inline unsigned getCPUTime()
GetThreadTimes(GetCurrentThread(), &creationTime, &exitTime, &kernelTime.fileTime, &userTime.fileTime); GetThreadTimes(GetCurrentThread(), &creationTime, &exitTime, &kernelTime.fileTime, &userTime.fileTime);
return userTime.fileTimeAsLong / 10000 + kernelTime.fileTimeAsLong / 10000; return userTime.fileTimeAsLong / 10000 + kernelTime.fileTimeAsLong / 10000;
#elif PLATFORM(BREWMP)
// This function returns a continuously and linearly increasing millisecond
// timer from the time the device was powered on.
// There is only one thread in BREW, so this is enough.
return GETUPTIMEMS();
#else #else
// FIXME: We should return the time the current thread has spent executing. // FIXME: We should return the time the current thread has spent executing.
return currentTime() * 1000; return currentTime() * 1000;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment