Added time function from inverse
This commit is contained in:
@@ -132,4 +132,12 @@ export default class SharedEndpoints {
|
||||
getApiAnnouncements(): GenericAPIResponse {
|
||||
return this.requestWrapper.get('v2/public/announcement');
|
||||
}
|
||||
|
||||
async getTimeOffset(): Promise<number> {
|
||||
const start = Date.now();
|
||||
return this.getServerTime().then(result => {
|
||||
const end = Date.now();
|
||||
return Math.ceil((result.time_now * 1000) - end + ((end - start) / 2));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user