import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
-import java.util.Date;
import java.util.StringTokenizer;
/**
/**
* Time at which the window size was refreshed.
*/
- private Date lastQueryWindowTime;
+ private long lastQueryWindowTime;
/**
* Username getter.
* Re-query the text window size.
*/
public void queryWindowSize() {
- if (lastQueryWindowTime == null) {
- lastQueryWindowTime = new Date();
+ if (lastQueryWindowTime == 0) {
+ lastQueryWindowTime = System.currentTimeMillis();
} else {
- Date now = new Date();
- if (now.getTime() - lastQueryWindowTime.getTime() < 3000) {
- // Don't re-spawn stty, it's been too soon.
+ long nowTime = System.currentTimeMillis();
+ if (nowTime - lastQueryWindowTime < 1000) {
+ // Don't re-spawn stty if it hasn't been a full second since
+ // the last time.
return;
}
}