Here you can find the source of toSeconds(long nanoseconds)
Parameter | Description |
---|---|
nanoseconds | a parameter |
public static double toSeconds(long nanoseconds)
//package com.java2s; public class Main { public static final double NANOSECONDS_PER_MILLISECONDS = 1000000, MILLISECONDS_PER_SECONDS = 1000, SECONDS_PER_HOUR = 3600;//from w ww. j a v a 2 s. com /** * Converts nanoseconds to seconds * @param nanoseconds */ public static double toSeconds(long nanoseconds) { return toSeconds((double) nanoseconds); } /** * Converts nanoseconds to seconds * @param nanoseconds */ public static double toSeconds(double nanoseconds) { double ms = nanoseconds / NANOSECONDS_PER_MILLISECONDS; return ms / MILLISECONDS_PER_SECONDS; } }