MCPcopy Index your code
hub / github.com/jabbany/CommentCoreLibrary / TimeKeeper

Class TimeKeeper

src/scripting/api/Runtime/Timer.ts:226–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224 * costs.
225 */
226 export class TimeKeeper {
227 private _clock:Function;
228 private _lastTime:number;
229
230 constructor(clock:Function = () => Date.now()) {
231 this._clock = clock;
232 this.reset();
233 }
234
235 get elapsed():number {
236 return this._clock() - this._lastTime;
237 }
238
239 public reset():void {
240 this._lastTime = this._clock();
241 }
242 }
243
244 /** Timer Related Items**/
245

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected