Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package server;
- public class Engine extends Thread {
- @Override
- public void run() {
- System.out.println("Server engine initialized");
- while (true) {
- long cycleStart = System.currentTimeMillis();
- try {
- long cycleEnd = System.currentTimeMillis();
- long cycle = (600 - (cycleStart - cycleEnd));
- if (true) {
- Thread.sleep(cycle);
- }
- System.out.println(cycle);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment