回答編集履歴
1
コメント追加
answer
CHANGED
@@ -5,7 +5,8 @@
|
|
5
5
|
SimpleDateFormat d = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
6
6
|
|
7
7
|
String prev = "";
|
8
|
+
// while(System.currentTimeMillis() % 1000 != 0); // 2回目の表示を1秒後にするためwait
|
8
|
-
for(int i = 0; i < 30;) { // 30回=30秒 表示
|
9
|
+
for(int i = 0; i < 30;) { // 30回=30秒 表示(30回表示だと29秒か・・・)
|
9
10
|
String now = d.format(new Date());
|
10
11
|
if(!prev.equals(now)) { // 秒が変わったら
|
11
12
|
i++; // i のインクリメントはforでなく、ここで行う
|