Fast counting timer in JavaFX
<p>For effect, I want a label to display time like a stop watch would. The time starts at 0, and ends somewhere around 2 or 3 seconds. The service is stopped when desired. The issue I am having, is because I am trying to update the text 1000 times per second, the timer is lagging behind.</p>

<p>Like I said, this is for effect and will be hidden as soon as the timer stops, but the time should be fairly accurate, not 3 seconds behind.</p>

<p>Is there any way I can make this faster? I would like to have all 4 decimal places if possible.</p>

<pre><code>timer = new Label();
DoubleProperty time = new SimpleDoubleProperty(0.0);
timer.textProperty().bind(Bindings.createStringBinding(() -&gt; {
    return MessageFormat.format(gui.getResourceBundle().getString("ui.gui.derbydisplay.timer"), time.get());
}, time));

Service&lt;Void&gt; countUpService = new Service&lt;Void&gt;() {
    @Override
    protected Task&lt;Void&gt; createTask() {
        return new Task&lt;Void&gt;() {
            @Override
            protected Void call() throws Exception {
                while (!isCancelled()) {
                    Platform.runLater(() -&gt; time.set(time.get() + 0.0001));
                    Thread.sleep(1);
                }
                return null;
            }
        };
    }
};
</code></pre>