After I've been running my program for a while, it freezes and gives me this error in the console:
Exception in thread "Thread-4" java.lang.IllegalArgumentException: timeout value is negative
at java.lang.Thread.sleep(Native Method)
It gives me a line to where the error occurs, which is the same line where it says "try":
while (true){
if(nextRepaintIn > Calendar.getInstance().getTimeInMillis()){
try {Thread.sleep(nextRepaintIn - Calendar.getInstance().getTimeInMillis());
} catch (InterruptedException ex) {
// none;
}
}
nextRepaintIn = Calendar.getInstance().getTimeInMillis()+1000/maxFps;
Does anyone of you have any idea of what's wrong?