| Differences between
and this patch
- a/Source/JavaScriptCore/ChangeLog +14 lines
Lines 1-3 a/Source/JavaScriptCore/ChangeLog_sec1
1
2011-12-20  Mark Dyer  <mark.dyer@sencha.com>
2
3
        Implement montonicallyIncreasingClock() on Qt
4
        https://bugs.webkit.org/show_bug.cgi?id=62159
5
6
        Reviewed by NOBODY (OOPS!).
7
        
8
        Returns the number of seconds since the first time the function is called.
9
        Per recommendations in bug, implementation is based on QElapsedTimer class.
10
11
        * wtf/CurrentTime.cpp:
12
        (WTF::currentTime):
13
        (WTF::monotonicallyIncreasingTime):
14
1
2011-12-13  Oliver Hunt  <oliver@apple.com>
15
2011-12-13  Oliver Hunt  <oliver@apple.com>
2
16
3
        Arguments object doesn't handle mutation of length property correctly
17
        Arguments object doesn't handle mutation of length property correctly
- a/Source/JavaScriptCore/wtf/CurrentTime.cpp -1 / +22 lines
Lines 58-63 extern "C" time_t mktime(struct tm *t); a/Source/JavaScriptCore/wtf/CurrentTime.cpp_sec1
58
58
59
#elif PLATFORM(GTK)
59
#elif PLATFORM(GTK)
60
#include <glib.h>
60
#include <glib.h>
61
#elif PLATFORM(QT)
62
#include <QElapsedTimer>
63
#include <sys/time.h>
61
#elif PLATFORM(WX)
64
#elif PLATFORM(WX)
62
#include <wx/datetime.h>
65
#include <wx/datetime.h>
63
#elif PLATFORM(EFL)
66
#elif PLATFORM(EFL)
Lines 165-171 double currentTime() a/Source/JavaScriptCore/wtf/CurrentTime.cpp_sec2
165
    // ftime returns the information we want, but doesn't have sufficient resolution.
168
    // ftime returns the information we want, but doesn't have sufficient resolution.
166
    // QueryPerformanceCounter has high resolution, but is only usable to measure time intervals.
169
    // QueryPerformanceCounter has high resolution, but is only usable to measure time intervals.
167
    // To combine them, we call ftime and QueryPerformanceCounter initially. Later calls will use QueryPerformanceCounter
170
    // To combine them, we call ftime and QueryPerformanceCounter initially. Later calls will use QueryPerformanceCounter
168
    // by itself, adding the delta to the saved ftime.  We periodically re-sync to correct for drift.
171
    // by itself, adding the delta to the saved ftime. We periodically re-sync to correct for drift.
169
    static double syncLowResUTCTime;
172
    static double syncLowResUTCTime;
170
    static double syncHighResUpTime;
173
    static double syncHighResUpTime;
171
    static double lastUTCTime;
174
    static double lastUTCTime;
Lines 316-321 double monotonicallyIncreasingTime() a/Source/JavaScriptCore/wtf/CurrentTime.cpp_sec3
316
{
319
{
317
    return static_cast<double>(g_get_monotonic_time() / 1000000.0);
320
    return static_cast<double>(g_get_monotonic_time() / 1000000.0);
318
}
321
}
322
#elif PLATFORM(QT)
323
324
double monotonicallyIncreasingTime()
325
{
326
    static QElapsedTimer* elapsedTimer = 0;
327
    static double lastTime = 0;
328
    if (!elapsedTimer) {
329
        elapsedTimer = new QElapsedTimer();
330
        elapsedTimer->start();
331
    }
332
    double elapsedTime = elapsedTimer->elapsed() / 1000.0;
333
334
    if (elapsedTime <= lastTime)
335
        return lastTime;
336
337
    lastTime = elapsedTime;
338
    return elapsedTime;
339
}
319
340
320
#else
341
#else
321
342

Return to Bug 62159