Here you can find the source of nanoToSeconds(double nano)
public static double nanoToSeconds(double nano)
//package com.java2s; /************************************************************************************** * Copyright (C) 2006-2015 EsperTech Inc. All rights reserved. * * http://esper.codehaus.org * * http://www.espertech.com * * ---------------------------------------------------------------------------------- * * The software in this package is published under the terms of the GPL license * * a copy of which has been included with this distribution in the license.txt file. * **************************************************************************************/ public class Main { public static double nanoToSeconds(long nano) { double milli = Math.round((double) nano / 1000000.0); return milli / 1000.0; }// ww w .j a va 2s. c om public static double nanoToSeconds(double nano) { double milli = Math.round(nano / 1000000.0); return milli / 1000.0; } }