summaryrefslogtreecommitdiffstats
path: root/js/src/jsdate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jsdate.cpp')
-rwxr-xr-x[-rw-r--r--]js/src/jsdate.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp
index d73fb93d2..ccaeda2a3 100644..100755
--- a/js/src/jsdate.cpp
+++ b/js/src/jsdate.cpp
@@ -1232,7 +1232,10 @@ date_parse(JSContext* cx, unsigned argc, Value* vp)
static ClippedTime
NowAsMillis()
{
- return TimeClip(static_cast<double>(PRMJ_Now()) / PRMJ_USEC_PER_MSEC);
+ const double maxResolutionMs = 2;
+ double timestamp = static_cast<double>(PRMJ_Now()) / PRMJ_USEC_PER_MSEC;
+ timestamp = floor(timestamp / maxResolutionMs) * maxResolutionMs;
+ return TimeClip(timestamp);
}
bool