浏览代码

Use System.currentTimeMillis()

master
Ben Kurtovic 12 年前
父节点
当前提交
361b560d36
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. +2
    -3
      src/Render.java

+ 2
- 3
src/Render.java 查看文件

@@ -1,6 +1,5 @@
package edu.stuy.goldfish;
import java.util.Date;
import java.awt.Canvas;
import java.awt.Dimension;
import java.awt.Graphics;
@@ -99,7 +98,7 @@ public class Render extends Canvas implements Runnable {
}
public void sleep() {
long since = (new Date()).getTime() - _last_tick;
long since = System.currentTimeMillis() - _last_tick;
if (since < 1000 / max_fps) {
try {
Thread.sleep(1000 / max_fps - since);
@@ -108,7 +107,7 @@ public class Render extends Canvas implements Runnable {
return;
}
}
_last_tick = (new Date()).getTime();
_last_tick = System.currentTimeMillis();
}
public void setGrid(Grid g) {


正在加载...
取消
保存