| Differences between
and this patch
- a/Source/JavaScriptCore/ChangeLog +10 lines
Lines 1-3 a/Source/JavaScriptCore/ChangeLog_sec1
1
2011-06-07  Jason Liu  <jason.liu@torchmobile.com.cn>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Implement montonicallyIncreasingClock() on Linux 
6
        https://bugs.webkit.org/show_bug.cgi?id=62159
7
8
        * wtf/CurrentTime.cpp:
9
        (WTF::montonicallyIncreasingClock):
10
1
2011-05-30  Hojong Han  <hojong.han@samsung.com>
11
2011-05-30  Hojong Han  <hojong.han@samsung.com>
2
12
3
        Reviewed by Geoffrey Garen.
13
        Reviewed by Geoffrey Garen.
- a/Source/JavaScriptCore/wtf/CurrentTime.cpp +21 lines
Lines 61-66 extern "C" time_t mktime(struct tm *t); a/Source/JavaScriptCore/wtf/CurrentTime.cpp_sec1
61
#include <AEEStdLib.h>
61
#include <AEEStdLib.h>
62
#else
62
#else
63
#include <sys/time.h>
63
#include <sys/time.h>
64
#include <sys/times.h>
65
#include <unistd.h>
66
#include <wtf/AlwaysInline.h>
64
#endif
67
#endif
65
68
66
#if PLATFORM(CHROMIUM)
69
#if PLATFORM(CHROMIUM)
Lines 294-297 double currentTime() a/Source/JavaScriptCore/wtf/CurrentTime.cpp_sec2
294
297
295
#endif
298
#endif
296
299
300
#if OS(LINUX)
301
302
double montonicallyIncreasingClock()
303
{
304
    static struct tms tmsUnused;
305
    static double startTime = currentTime();
306
    static clock_t startTicks = times(&tmsUnused);
307
    static long int ticksPerSecond = sysconf(_SC_CLK_TCK);
308
    clock_t currentTicks = times(&tmsUnused);
309
    // Overflow, just fallback to currentTime()
310
    if (UNLIKELY(startTicks == static_cast<clock_t>(-1) || currentTicks == static_cast<clock_t>(-1)))
311
        return currentTime();
312
    ASSERT(ticksPerSecond > 0);
313
    return startTime + static_cast<double>(currentTicks - startTicks) / ticksPerSecond;
314
}
315
316
#endif
317
297
} // namespace WTF
318
} // namespace WTF

Return to Bug 62159