Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java settimeout

Try :

public static void setTimeout(Runnable runnable, int delay){
    new Thread(() -> {
        try {
            Thread.sleep(delay);
            runnable.run();
        }
        catch (Exception e){
            System.err.println(e);
        }
    }).start();
}

To called with lambda exception:
setTimeout(() -> System.out.println("test"), 1000);
 
PREVIOUS NEXT
Tagged: #java #settimeout
ADD COMMENT
Topic
Name
2+6 =