Java Minute sleepToNextMinute()

Here you can find the source of sleepToNextMinute()

Description

sleep To Next Minute

License

Apache License

Declaration

public static boolean sleepToNextMinute() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static final long ONE_MINUTE = 60 * 1000L;

    public static boolean sleepToNextMinute() {
        try {/*from  w w  w . j  a v  a  2 s . c o m*/
            long current = System.currentTimeMillis();

            Thread.sleep(ONE_MINUTE - current % ONE_MINUTE + 500);
            return true;
        } catch (InterruptedException e) {
            return false;
        }
    }
}

Related

  1. refineHourMinute(String timeString)
  2. samplesToMinutes(int sampleRate, int samples)
  3. secsToMinutes(long secs)
  4. selectOfToday(int hour, int minute, int second, int millisecond)
  5. shortTimeToMinutes(String time)
  6. TimeDeltaString_JustMinutesSecs(long ms)
  7. timeFromMinutes(Long minutes)
  8. toXMinutes(float t)
  9. travelTimeAt100kphInMinutes(double ODDist)