Here you can find the source of convertToTenthsOfASecond(long epochSeconds, int nanos)
Parameter | Description |
---|---|
epochSeconds |   |
nanos |   |
Parameter | Description |
---|---|
NumberFormatException |   |
public static long convertToTenthsOfASecond(long epochSeconds, int nanos) throws NumberFormatException
//package com.java2s; //License from project: Open Source License public class Main { /**/*from ww w . j a v a2 s. co m*/ * Event rate rate limiting uses a tenths of a seconds units to cater to monitor intervals of 0.1 seconds, 0.5 seconds etc.. * This converts a epochSeconds+nanos to time in terms of tenths of a second. * @param epochSeconds   * @param nanos   * @return TenthsOfASecond   * @throws NumberFormatException   */ public static long convertToTenthsOfASecond(long epochSeconds, int nanos) throws NumberFormatException { int tenthsPieceOfNanos = (nanos / (100000000)); if (tenthsPieceOfNanos > 9) { throw new NumberFormatException( "Tenths of nanos cannot be greater than 9 but this is " + tenthsPieceOfNanos); } return epochSeconds * 10 + tenthsPieceOfNanos; } }