Java tutorial
//package com.java2s; public class Main { private static String getBucketedTime(long paramLong) { if (paramLong < 1000L) return String.valueOf(100L * (paramLong / 100L)) + "ms"; return String.valueOf(Math.max(500L * (paramLong / 500L) / 1000.0D, 1.0D) + "s"); } }