1
0
mirror of https://github.com/psychopy/psychojs.git synced 2025-05-10 10:40:54 +00:00

PAR: Mirror the Clock.addTime function from PsychoPy

This commit is contained in:
TEParsons 2024-09-19 10:10:07 +01:00
parent 9265fd8502
commit 6acaac8064

View File

@ -135,6 +135,19 @@ export class Clock extends MonotonicClock
}
/**
* Progress the current time of the clock.
*
* @param {number} [deltaTime] the time (s) to be added to the clock's current time
*/
addTime(deltaTime)
{
this._timeAtLastReset -= deltaTime;
}
/**
* DEPRECATED: Clock.add() is deprecated in favor of .addTime() due to the counterintuitive
* design (it added time to the baseline, which reduced the values returned from getTime() )
*
* Add more time to the clock's 'start' time (t0).
*
* <p>Note: by adding time to t0, the current time is pushed forward (it becomes