Merge pull request from kchadha/timer-perf

Improve the performance of the timer utilitiy
This commit is contained in:
Karishma Chadha 2019-01-23 11:41:41 -05:00 committed by GitHub
commit 98b92be2d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,6 +21,10 @@ class BlockUtility {
* @type {?Thread}
*/
this.thread = thread;
this._nowObj = {
now: () => this.sequencer.runtime.currentMSecs
};
}
/**
@ -46,9 +50,7 @@ class BlockUtility {
*/
get nowObj () {
if (this.runtime) {
return {
now: () => this.runtime.currentMSecs
};
return this._nowObj;
}
return null;
}