- 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.