Here you can find the source of formatTimeInNanos(long time)
public static String formatTimeInNanos(long time)
//package com.java2s; //License from project: Open Source License public class Main { private static final String DECIMAL_FORMAT = "%.03f"; public static String formatTimeInNanos(long time) { return formatDecimal(nanosToMillis(time)); }/*from w w w. j a v a 2s .com*/ public static String formatDecimal(double decimal) { return String.format(DECIMAL_FORMAT, decimal).replace('.', ','); } public static double nanosToMillis(long nanos) { return nanos * 0.000001; } }