public static String nanoSecToString ( final long nS ) { final long rem_nS = ( long ) ( nS % 1000.0 ) ; final long rem_uS = ( long ) ( ( nS / 1000.0 ) % 1000.0 ) ; final long rem_mS = ( long ) ( ( nS / 1000000.0 ) % 1000.0 ) ; final long sec = ( long ) ( nS / 1000000000.0 ) ; final String nSstr = zeroPad ( Long . toString ( rem_nS ) , 3 ) ; final String uSstr = zeroPad ( Long . toString ( rem_uS ) , 3 ) ; final String mSstr = zeroPad ( Long . toString ( rem_mS ) , 3 ) ; return String . format ( "%d.%3s_%3s_%3s" , sec , mSstr , uSstr , nSstr ) ; }
Returns the given time in nanoseconds formatted as Sec . mSec uSec nSec