How can I set timer in LIBGDX
<p>I want to change my balloon's location (randomly) in every second. I wrote this code: </p>

<pre><code>public void render() {

    int initialDelay = 1000; // start after 1 seconds
    int period = 1000;        // repeat every 1 seconds
    Timer timer = new Timer();
    TimerTask task = new TimerTask() {
        public void run() {
            rand_x = (r.nextInt(1840));
            rand_y = (r.nextInt(1000));
            balloon.x = rand_x;
            balloon.y = rand_y;
            System.out.println("deneme");
        }
    };
    timer.schedule(task, initialDelay, period);

    Gdx.gl.glClearColor(56, 143, 189, 1);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

    camera.update();
    batch.setProjectionMatrix(camera.combined);

    batch.begin();
    batch.draw(balloon, balloon_rec.x, balloon_rec.y);
    batch.end();

}
</code></pre>

<p>initialDelay is working. Balloon's location is changing after 1 second when I run program. But period is not working. Where is the problem?</p>