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