Commit 37834224 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: http://svn.webkit.org/repository/webkit/trunk@53926 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7e9dacdd
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>
Reviewed by Oliver Hunt.
......
......@@ -41,6 +41,10 @@
#include "CurrentTime.h"
#endif
#if PLATFORM(BREWMP)
#include <AEEStdLib.h>
#endif
using namespace std;
namespace JSC {
......@@ -80,6 +84,11 @@ static inline unsigned getCPUTime()
GetThreadTimes(GetCurrentThread(), &creationTime, &exitTime, &kernelTime.fileTime, &userTime.fileTime);
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
// FIXME: We should return the time the current thread has spent executing.
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