How can i synchronize the time (second , hour).
i have this
int minuto = cal.get(Calendar.MINUTE);
int day_Completed = 1440;
but i have no idea how can i do it.
I tried doing this
changing the pc time when a loop is running to see if the var minuto change.
but doesn’t work.
An instance of calendar statically reflects one moment in time. It won’t get updated automatically, it is not behaving like a clock.
If you want to “synchronize” with the actual time, then you have to
Thread.sleepfor a startSystem.currentTimMillis()) and