Here you can find the source of roundTimeToTheNearestSecondInMilliseconds(long timeInMilliseconds)
Parameter | Description |
---|---|
timeInMilliseconds | a parameter |
public static long roundTimeToTheNearestSecondInMilliseconds(long timeInMilliseconds)
//package com.java2s; //License from project: Apache License public class Main { /**//from w w w. ja va2 s.c o m * Round time in Milliseconds to the nearest second, and return as time in milliseconds * * @param timeInMilliseconds * @return roundedTimeInMilliSeconds rounded to the nearest second. */ public static long roundTimeToTheNearestSecondInMilliseconds(long timeInMilliseconds) { double timeInSeconds = ((double) timeInMilliseconds) / 1000.0; timeInSeconds = Math.round(timeInSeconds); long roundedTimeInMilliseconds = (long) (timeInSeconds * 1000.0); return roundedTimeInMilliseconds; } }