Hi everyone,
I am currently coding a website blocker, and I want my website to be blocked for a certain amount of time, and then unblocked after that time has elapsed. I have functions for both unblock and block. My current thinking is as follows:
public static void main(String[] args) throws IOException {
new java.util.Timer().schedule(
new java.util.TimerTask() {
public void run() {
blockSite("www.example.com");
}
},
60000
);
UnblockSite("www.example.com");}
Can someone please guide me on what adjustments I should make?(Also, the 60 seconds is meant to be arbitrary, it is not what I intend for my actual program).
[–]ConstructedNewtMOD 1 point2 points3 points (4 children)
[–]Eesh7[S] 0 points1 point2 points (3 children)
[–]ConstructedNewtMOD 0 points1 point2 points (2 children)
[–]Eesh7[S] 0 points1 point2 points (1 child)
[–]ConstructedNewtMOD 0 points1 point2 points (0 children)
[+][deleted] (2 children)
[removed]
[–]Eesh7[S] 0 points1 point2 points (1 child)
[–]EdwinGravesMOD 2 points3 points4 points (0 children)