Complete the code to schedule a punctuator that triggers every 1000 milliseconds.
context.schedule([1], PunctuationType.WALL_CLOCK_TIME, callback);The schedule method requires the interval in milliseconds. Using 1000 sets the trigger to every 1 second.
Complete the code to use the correct PunctuationType for wall-clock time triggers.
context.schedule(1000, [1], callback);
WALL_CLOCK_TIME is used to trigger punctuators based on real-world clock time.
Fix the error in the code to correctly schedule a punctuator every 5 seconds.
context.schedule([1], PunctuationType.WALL_CLOCK_TIME, callback);The interval must be in milliseconds. 5000 milliseconds equals 5 seconds.
Fill both blanks to schedule a punctuator every 2 seconds using the correct PunctuationType.
context.schedule([1], [2], callback);
2000 milliseconds equals 2 seconds, and WALL_CLOCK_TIME triggers based on real time.
Fill all three blanks to schedule a punctuator every 3 seconds that prints 'Tick' each time.
context.schedule([1], [2], timestamp -> { System.out.println([3]); });
3000 milliseconds is 3 seconds, WALL_CLOCK_TIME triggers by real time, and printing "Tick" matches the requirement.