Skip to content

Commit

Permalink
gui improvements / timing
Browse files Browse the repository at this point in the history
  • Loading branch information
artoonie committed May 8, 2024
1 parent 3eca021 commit 8fdb759
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void initialize(GuiConfigController controller, int numCandidates, int nu
guiConfigController = controller;
numberOfCandidates.setText("Number of candidates: " + numCandidates);
numberOfCvrFiles.setText("Number of CVR Files: " + numCvrs);
numberOfBallots.setText("Number of Ballots: <load CVRs to count>");
numberOfBallots.setText("Number of Ballots: <Check Ballot Counts to load>");
numberOfBallots.setOpacity(0.5);
filledFieldStyle = "";
unfilledFieldStyle = "-fx-border-color: red;";
Expand Down Expand Up @@ -190,6 +190,8 @@ public void buttonOpenResultsClicked(ActionEvent actionEvent) {
}

private void watchTabulatorServiceProgress(Service<Boolean> service) {
// Measure time it takes for the function to complete
long startTime = System.currentTimeMillis();
EventHandler<WorkerStateEvent> onSuceededEvent = workerStateEvent -> {
lastTaskFailed = service.getValue();
if (lastTaskFailed) {
Expand All @@ -198,6 +200,8 @@ private void watchTabulatorServiceProgress(Service<Boolean> service) {
openResultsButton.setText(buttonViewErrorLogsText);
}
enableButtonsUpTo(openResultsButton);
long endTime = System.currentTimeMillis();
Logger.info("Tabulation took " + (endTime - startTime) / 1000 + " seconds.");
};
watchGenericService(service, onSuceededEvent);
}
Expand Down

0 comments on commit 8fdb759

Please sign in to comment.