INNER CODE UNIT · JavaScript

elapsedSinceStarted

moddio/taro · engine/components/network/net.io/net.io-client/index.js:132

			var elapsedSinceStarted = (now - this._started) * 0.001;
			this._averageSendRate = this._sentBytesTotal / elapsedSinceStarted;

			// average in last second
			var elapsed = (now - this._lastSentUpdated) * 0.001;
			if (elapsed >= 1) {
				this._sendRate = this._sentBytesSinceLastUpdate / elapsed;
				this._lastSentUpdated = now;
				this._sentBytesSinceLastUpdate = 0;
				// plot against 2x all time average
				if (statsPanels.sent) {
					statsPanels.sent._sentPanel.update(this._sendRate, this._averageSendRate * 2);
				}
			}
		} else {
			this.disconnect();
		}
	},

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…