I have a repeating task every 30 seconds to broadcast a message.. How would I get the current second the task is on? I’m trying to have multiple broadcasts set to different times (10,20,30) for example Sent from my iPhone using Tapatalk
It’s a repeating task, something like this? Code: Int seconds =30; public void run() { if seconds == 10 //broadcast 1 Else if seconds == 20 //broadcast 2 } }, 0, 600); Sent from my iPhone using Tapatalk
If it’s a repeating task how do I reset the seconds or am I doing that here with “0, 600” ? Also, with decreasing, where do I put that? Inside my run method or directly after it’s called? “Seconds - -;” ? Thanks for your help Tim Sent from my iPhone using Tapatalk
Used a repeating task and defined an int variable to 60, inside the run method I started the countdown - -; and checked for each time. To repeat the timer I checked if the int was 0 and set it back to 90, continuing the loop again. Thanks @timtower problem solved Sent from my iPhone using Tapatalk