Java examples for java.util:Second
nanoseconds To String
//package com.java2s; public class Main { @SuppressWarnings("AutoBoxing") public static String nanosToString(final long nanos) { long value = nanos; final long nrNanoseconds = value % 1000; value /= 1000;//from w w w. j a v a2s .c o m final long nrMicroseconds = value % 1000; value /= 1000; return String.format("%d ms, %03d.%03d ?s", value, nrMicroseconds, nrNanoseconds); } }