diff --git a/lib/protocol/network.js b/lib/protocol/network.js index 676922a2..c25beaf1 100644 --- a/lib/protocol/network.js +++ b/lib/protocol/network.js @@ -137,6 +137,15 @@ Network.prototype.now = function now() { return this.time.now(); }; +/** + * Get network adjusted time in milliseconds. + * @returns {Number} + */ + +Network.prototype.ms = function ms() { + return this.time.ms(); +}; + /** * Create a network. Get existing network if possible. * @param {NetworkType|Object} options diff --git a/lib/protocol/timedata.js b/lib/protocol/timedata.js index 227fd0d8..cdb85f99 100644 --- a/lib/protocol/timedata.js +++ b/lib/protocol/timedata.js @@ -120,6 +120,15 @@ TimeData.prototype.local = function local(time) { return time - this.offset; }; +/** + * Get the current adjusted time in milliseconds. + * @returns {Number} Adjusted Time. + */ + +TimeData.prototype.ms = function ms() { + return util.ms() + this.offset * 1000; +}; + /* * Helpers */