Here you can find the source of roundToSecond(final long pTime)
Parameter | Description |
---|---|
pTime | time |
public static long roundToSecond(final long pTime)
//package com.java2s; public class Main { /** One second: 1000 milliseconds. */ public static final long SECOND = 1000l; /**/*from w w w. j ava2 s.c o m*/ * Rounds the given time down to the closest second. * * @param pTime time * @return the time rounded to the closest second. */ public static long roundToSecond(final long pTime) { return (pTime / SECOND) * SECOND; } }