I have a progress bar in a desktop application user interface (written in JavaFX). In general, is there an ideal update interval to use (in milliseconds) for updating progress bars with continuously changing progress (such as in the case of a file copy or download)? Right now I am getting good results with a 20ms update interval. That is, I have a timer thread that updates the progress bar every 20ms. My reasoning for using this value is that 20ms is higher than 30 FPS, which is supposed to be where the human eye stops seeing individual frames. Is there any reason to avoid using lower intervals, such as 1ms? What is the best practice for this?
Asked
Active
Viewed 221 times
1 Answers
2
Use a Task for your operation and call updateProgress on the task as often as you like. Bind your ProgressBar's progress property to the task's progress property. The JavaFX system will coalesce any superfluous updates so that the progress property is updated once per pulse. By default the JavaFX system will process pulses 60 times a second.

jewelsea
- 150,031
- 14
- 366
- 406