'use strict';

class Clock {
	constructor() {
		this.lastUpdate = Date.now();
	}
	restart() {
		var now = Date.now();
		var delta = now - this.lastUpdate;
		this.lastUpdate = now;
		return delta;
	}
}

'use strict';

class Clock {
	constructor() {
		this.lastUpdate = window.performance.now();
	}
	restart() {
		var now = window.performance.now();
		var delta = now - this.lastUpdate;
		this.lastUpdate = now;
		return delta;
	}
}

Use high-performance and monotonic timer in Clock
Use high-performance and monotonic timer in Clock
