Creating and Printing a Delay
in
Programming Questions
•
1 year ago
So I'm trying to write some code for a basic alarm programme. The alarm uses an m4v file to play an audio file when triggered, and I want to make it so that when my alarm plays there is a delay of 8 seconds. In addition the delay time in numbers (
int values) should be displayed in the console window along with a print statement to mark the alarm as on e.g:
- //Alarm
- //Counting: 1 2 3 4 5 6 7 8
- My code so far:
- import processing.video.Movie;
- int alarm_hour;
- int alarm_minute;
- int alarm;
- int current_time;
- alarm_hour = 11;
- alarm_minute = 44;
- alarm = alarm_hour + alarm_minute;
- current_time = hour() + minute();
- //Where I'm attempting to place a delay that prints out the number of seconds (8 seconds) in int values
- if( alarm == current_time ){
- println("ALARM!!!");
- delay(8000);
- }
- new Movie(this,"alarm.m4v");
1