Shreyas arya

Generation

generate functionThu, 09 Feb 2023

Number of retries = 3 Should complete all the retries under 10 seconds

public class MyClass { public static int attempts = 3; public static void main(String[] args) { // write your code here for (int i=1; i<=attempts; i++) { long start = System.currentTimeMillis(); // do something while(System.currentTimeMillis() - start < 10000) { } if (i == attempts) { System.out.println("Number of retries = " + attempts); System.out.println("Should complete all the retries under 10 seconds"); } } } }

Questions about programming?Chat with your personal AI assistant