INNER CODE UNIT · JavaScript
elapsed
moddio/taro · engine/components/network/net.io/net.io-client/index.js:189
var elapsed = (now - this._lastReceiveUpdated) * 0.001;
if (elapsed >= 1) {
this._receiveRate = this._receivedBytesSinceLastUpdate / elapsed;
this._lastReceiveUpdated = now;
this._receivedBytesSinceLastUpdate = 0;
// plot against 2x all time average
if (statsPanels.received) {
statsPanels.received._receivedPanel.update(this._receiveRate, this._averageReceiveRate * 2);
}
var bandwidthUsed = (this._receivedBytesTotal + this._sentBytesTotal) / 1024;
if (statsPanels.bandwidth) {
statsPanels.bandwidth._bandwidthPanel.update(bandwidthUsed, bandwidthUsed * 2);
}
}
// Output debug if required
if (this._debug) {