Alarm type
Constructor of AlarmType
// Create alarm typeconst customAlarmType = new Stopwatch.AlarmType( "SNAP", ( time, alarmTime ) => { // Snap in 0.5 second increments return alarmTime - alarmTime % 500;} );// Alarm occurs after 5 secondsstopwatch.setAlarm( 5321, customAlarmType );
Alarm type id
function to calculate time
{StringOrNumber} id Alarm type id
{Function} timeCalculator function to calculate time
This is the default value for the alarm type. Regardless of the elapsed time, the argument value itself is used for the alarm.
This is the default value for the alarm type. The time obtained by adding the argument value from the elapsed time becomes the alarm time.
Calculates and returns the alarm time.
// Alarm time calculationconst alarmTime = customAlarmType.timeCalculation( 3000, 3435 );
elapsed time
alarm time
Calculated alarm time
Generated using TypeDoc
Alarm type