Here you can find the source of formatMilliIntervalAsSeconds(long interval)
Parameter | Description |
---|---|
interval | interval in milliseconds. |
public static String formatMilliIntervalAsSeconds(long interval)
//package com.java2s; public class Main { /**// ww w . jav a 2 s.c o m * Format a millisecond interval as number of seconds (with fracitonal part). * * @param interval interval in milliseconds. * @return interval as number of seconds (with fracitonal part). */ public static String formatMilliIntervalAsSeconds(long interval) { long seconds = interval / 1000; long millis = interval - seconds * 1000; StringBuilder buff = new StringBuilder(); buff.append(seconds).append("."); buff.append(millis).append("s"); return buff.toString(); } }