timedata/network: minor.

This commit is contained in:
Christopher Jeffrey 2017-03-06 18:25:06 -08:00
parent eeeff1f795
commit e823222e45
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
2 changed files with 18 additions and 0 deletions

View File

@ -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

View File

@ -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
*/