Java Second Round roundToNearestSecond(long time)

Here you can find the source of roundToNearestSecond(long time)

Description

round To Nearest Second

License

Open Source License

Declaration

static long roundToNearestSecond(long time) 

Method Source Code

//package com.java2s;

public class Main {
    static long roundToNearestSecond(long time) {
        return ((time + ((time >= 0) ? 500 : -500)) / 1000) * 1000;
    }/*from  w  ww  .  j av a2 s .c o m*/
}

Related

  1. roundMjdToSeconds(double timeStep)
  2. roundToSecond(final long pTime)