diff --git a/src/Time.txt b/src/Time.txt new file mode 100644 index 0000000..021e6e3 --- /dev/null +++ b/src/Time.txt @@ -0,0 +1,19 @@ +public class Main { + public static void main(String[] args) { + + // 処理前の時刻 + long startTime = System.currentTimeMillis(); + + int result = 0; + for (int i = 0; i i < 1000000; i++){ + result += 1; + } + + // 処理後の時刻 + long endTime = System.currentTieMillis(); + + System.out.println("開始時刻 :" +startTime + " ms"); + System.out.println("終了時刻 :" + endTime + " ms"); + System.out.println("処理時間 :" + (endTime - startTime) + " ms"); + } +} \ No newline at end of file