Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
時刻を同期するにはどうすればよいですか (秒、時)。私はこれを持っています
int minuto = cal.get(Calendar.MINUTE); int day_Completed = 1440;
しかし、どうすればいいのかわかりません。
私はこれをやってみました
ループが実行されているときにPC時間を変更して、var minutoが変化するかどうかを確認します。しかし、うまくいきません。
カレンダーのインスタンスは、ある瞬間を静的に反映します。自動的に更新されることはなく、時計のように動作しません。
実際の時間と「同期」したい場合は、
Thread.sleep
System.currentTimMillis()