JavaScriptCore/runtime/TimeoutChecker.cpp
changeset 2 303757a437d3
parent 0 4f2f89ce4247
--- a/JavaScriptCore/runtime/TimeoutChecker.cpp	Fri Sep 17 09:02:29 2010 +0300
+++ b/JavaScriptCore/runtime/TimeoutChecker.cpp	Mon Oct 04 01:32:07 2010 +0300
@@ -98,7 +98,10 @@
     return GETUPTIMEMS();
 #else
     // FIXME: We should return the time the current thread has spent executing.
-    return currentTime() * 1000;
+
+    // use a relative time from first call in order to avoid an overflow
+    static double firstTime = currentTime();
+    return (currentTime() - firstTime) * 1000;
 #endif
 }