in Education by
i tried to make the schedule() method wait till a specific hour and minute comes and start to execute the task but it didnt work because the method schedule() doesnt take hours and minutes as an argument, what is the replacment for this method? i'm i supposed make schedule for hours then when the hour comes the program check the minutes? then if both are correct it will start executing or what? P.S for making things easier to understand, how to make something similier to this : schedule(new TimerClass(), desired hours, desired minutes)? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
If you want to schedule for a particular clock time (rather than a delay from current time), here are some options: Use Quartz, if you're doing this enough to justify the additional library. Quartz makes it easy to specify clock times, and supports scheduling recurring events. Otherwise, at the time you're scheduling, compute the difference between the current time and the desired time. (Use the Calendar class to create clock times, convert to Dates, and getMillis().) Feed the difference to Timer -- or ScheduledThreadPoolExecutor.

Related questions

0 votes
    i tried to make the schedule() method wait till a specific hour and minute comes and start to execute ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    If a current of 0.5A flows through a metallic wire for 2 hours, then how many electrons would flow through the wire ? Select the correct answer from above options...
asked Jan 5, 2022 in Education by JackTerrance
0 votes
    There is a clock which shows false timing ie it shows 20 minutes less for each 1 hour. If the clock shows 12 noon now how ... ) 36 minutes B) 48 minutes C) 35 minutes D) 60 minutes...
asked Feb 14, 2021 in Education by JackTerrance
0 votes
0 votes
    How to get time in hours and the hour difference between login and logout times? I used the below ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 12, 2022 in Education by JackTerrance
0 votes
    How to get time in hours and the hour difference between login and logout times? I used the below ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 6, 2022 in Education by JackTerrance
0 votes
    How to get time in hours and the hour difference between login and logout times? I used the below ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 3, 2022 in Education by JackTerrance
0 votes
    Can anyone tell me how many hours to learn Salesforce? Select the correct answer from above options...
asked Jan 10, 2022 in Education by JackTerrance
0 votes
    Minute hand overlaps hour hand in 65 mins. In how many days it will gain 1440 hours ? A) 57 days B) 58 days C) 60 days D) 61 days...
asked Feb 14, 2021 in Education by JackTerrance
0 votes
    The charge associated with a bulb rated as 20 W, 200 V and used for 10 minutes is ____________ (a) 36 C ... for GATE EC Exam, Network Theory MCQ (Multiple Choice Questions)...
asked Oct 20, 2021 in Education by JackTerrance
0 votes
    Which of these classes can schedule task for execution in future? (a) Thread (b) Timer (c) System (d) ... More Utility Classes of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Which of these classes can schedule task for execution in future? (a) Thread (b) Timer (c) System ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    How many minutes is it until 6 o'clock if 50 minutes ago it was 4 times as many minutes past 3 o'clock ? A) 26 min B) 24 min C) 22 min D) 20 min...
asked Feb 14, 2021 in Education by JackTerrance
0 votes
    How many minutes is it until six o’clock if fifty minutes ago it was four times as many minutes past three o’clock?...
asked Feb 14, 2021 in Education by JackTerrance
0 votes
    How will you publish and schedule a workbook in Tableau Server?...
asked Oct 30, 2020 in Technology by JackTerrance
...