You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Or maybe you want to run some program with a timeout? 🕘
/* Main.java */importzer.exec.EXECTask;
importzer.exec.EXECResult;
importzer.exec.EXECResultCode;
publicclassMain
{
publicstaticvoidmain(String[] args)
{
/* * If we don't provide any argument to the "cat" * program, it will block the terminal (works * like a while true loop), allowing us to see * how the timeout works. */EXECResultres = EXECTask.exec("cat", 3000);
if (res.code() != EXECResultCode.OK)
{
System.out.println("[error]: " + res.message());
return;
}
System.out.println(res.message());
}
}
$ javac Main.java && java Main
[error]: too long.. (more than 3000 ms)