public void loop() {
        final KeyListener This = this;
        SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    view.getFrame().addKeyListener(This);
                    view.show();
                }
            });

        long target_delta = 1000/options.getFramerate();
        long delta = 1000/options.getFramerate();
        for (;;) {
            try {
                long last_compute = System.currentTimeMillis();
                model.compute(input, delta);
                view.update();

                delta = System.currentTimeMillis() - last_compute;

                if (delta < target_delta) {
                    Thread.currentThread().sleep(target_delta-delta);
                }
                delta = System.currentTimeMillis() - last_compute;


            } catch (Exception ignore) {}
        }
    }