我正在尝试测量执行时间,但我不知道在哪里,但该方法是在 try 块之前还是在内部?
ublic static void main(String[] args) {
long startTime = System.currentTimeMillis();
try {
SearchDetailsDialog dialog = new SearchDetailsDialog(null);
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}long endTime = System.currentTimeMillis();
long totalTime = ((endTime - startTime)/1000);
System.out.println("the execution time is:");
System.out.println(totalTime);
}