lib/policies/timestamp-generation.js
function MonotonicTimestampGenerator(warningThreshold, minLogInterval) {
  if (warningThreshold < 0) {
    throw new errors.ArgumentError('warningThreshold can not be lower than 0');
  }
  this._warningThreshold = warningThreshold || 1000;
  this._minLogInterval = 1000;
  if (typeof minLogInterval === 'number') {
    // A value under 1 will disable logging
    this._minLogInterval = minLogInterval;
  }
  this._micros = -1;
  this._lastDate = 0;
  this._lastLogDate = 0;
}
function MonotonicTimestampGenerator(warningThreshold, minLogInterval) {
  if (warningThreshold < 0) {
    throw new errors.ArgumentError('warningThreshold can not be lower than 0');
  }
  this._warningThreshold = warningThreshold || 1000;
  this._minLogInterval = 1000;
  if (typeof minLogInterval === 'number') {
    // A value under 1 will disable logging
    this._minLogInterval = minLogInterval;
  }
  this._micros = -1;
  this._lastDate = 0;
  this._lastLogDate = 0;
}
A timestamp generator that guarantees monotonically increasing timestamps and logs warnings when timestamps
drift in the future.
<p>
{@link Date} has millisecond precision and client timestamps require microsecond precision. This generator
keeps track of the last generated timestamp, and if the current time is within the same millisecond as the last,
it fills the microsecond portion of the new timestamp with the value of an incrementing counter.
</p>
@param {Number} [warningThreshold] Determines how far in the future timestamps are allowed to drift before a
warning is logged, expressed in milliseconds. Default: <code>1000</code>.
@param {Number} [minLogInterval] In case of multiple log events, it determines the time separation between log
events, expressed in milliseconds. Use 0 to disable. Default: <code>1000</code>.
@extends {TimestampGenerator}
@constructor