|
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 |
|