diff --git a/Libraries/BatchedBridge/MessageQueue.js b/Libraries/BatchedBridge/MessageQueue.js index 3912be6205bf3e..a7f1f5a3a5aacd 100644 --- a/Libraries/BatchedBridge/MessageQueue.js +++ b/Libraries/BatchedBridge/MessageQueue.js @@ -60,7 +60,7 @@ class MessageQueue { this._failureCallbacks = {}; this._callID = 0; this._lastFlush = 0; - this._eventLoopStartTime = new Date().getTime(); + this._eventLoopStartTime = Date.now(); this._immediatesCallback = null; if (__DEV__) { @@ -141,7 +141,7 @@ class MessageQueue { } getEventLoopRunningTime() { - return new Date().getTime() - this._eventLoopStartTime; + return Date.now() - this._eventLoopStartTime; } registerCallableModule(name: string, module: Object) { @@ -260,7 +260,7 @@ class MessageQueue { } this._queue[PARAMS].push(params); - const now = new Date().getTime(); + const now = Date.now(); if ( global.nativeFlushQueueImmediate && now - this._lastFlush >= MIN_TIME_BETWEEN_FLUSHES_MS @@ -340,7 +340,7 @@ class MessageQueue { } __callFunction(module: string, method: string, args: any[]): any { - this._lastFlush = new Date().getTime(); + this._lastFlush = Date.now(); this._eventLoopStartTime = this._lastFlush; if (__DEV__ || this.__spy) { Systrace.beginEvent(`${module}.${method}(${stringifySafe(args)})`); @@ -369,7 +369,7 @@ class MessageQueue { } __invokeCallback(cbID: number, args: any[]) { - this._lastFlush = new Date().getTime(); + this._lastFlush = Date.now(); this._eventLoopStartTime = this._lastFlush; // The rightmost bit of cbID indicates fail (0) or success (1), the other bits are the callID shifted left.