I need a loop to repeat at a specific time
For example 10 seconds :
while (Repeat every ten seconds)
{
// Code body
}
>Solution :
To pause the code execution into a java loop you can use Thread.sleep(Integer) method, that will stop the execution of the thread for the specified amount of milliseconds. Here there is an official example with a for loop. In your case you could do something like this:
while (1) {
/* your code here */
Thread.sleep(10000);
}
The body of the while loop will be executed once every 10 seconds.