public static String getElapsedTime(long delta) {
        if (delta < Duration.ofMinutes(1).toMillis()) {
            return LocaleUtils.getLocalizedString("global.less-minute");
        }
        else if (delta < Duration.ofHours(1).toMillis()) {
            long mins = delta / Duration.ofMinutes(1).toMillis();
            StringBuilder sb = new StringBuilder();
            sb.append(mins).append(' ');
            sb.append((mins==1) ? LocaleUtils.getLocalizedString("global.minute") : LocaleUtils.getLocalizedString("global.minutes"));
            return sb.toString();
        }
        else if (delta < Duration.ofDays(1).toMillis()) {
            long hours = delta / Duration.ofHours(1).toMillis();
            delta -= Duration.ofHours(hours).toMillis();
            long mins = delta / Duration.ofMinutes(1).toMillis();
            StringBuilder sb = new StringBuilder();
            sb.append(hours).append(' ');
            sb.append((hours == 1) ? LocaleUtils.getLocalizedString("global.hour") : LocaleUtils.getLocalizedString("global.hours"));
            sb.append(", ");
            sb.append(mins).append(' ');
            sb.append((mins == 1) ? LocaleUtils.getLocalizedString("global.minute") : LocaleUtils.getLocalizedString("global.minutes"));
            return sb.toString();
        } else {
            long days = delta / Duration.ofDays(1).toMillis();
            delta -= Duration.ofDays(days).toMillis();
            long hours = delta / Duration.ofHours(1).toMillis();
            delta -= Duration.ofHours(hours).toMillis();
            long mins = delta / Duration.ofMinutes(1).toMillis();
            StringBuilder sb = new StringBuilder();
            sb.append(days).append(' ');
            sb.append((days == 1) ? LocaleUtils.getLocalizedString("global.day") : LocaleUtils.getLocalizedString("global.days"));
            sb.append(", ");
            sb.append(hours).append(' ');
            sb.append((hours == 1) ? LocaleUtils.getLocalizedString("global.hour") : LocaleUtils.getLocalizedString("global.hours"));
            sb.append(", ");
            sb.append(mins).append(' ');
            sb.append((mins == 1) ? LocaleUtils.getLocalizedString("global.minute") : LocaleUtils.getLocalizedString("global.minutes"));
            return sb.toString();
        }
    }
Returns a textual representation for the time that has elapsed.

@param delta the elapsed time in milliseconds.
@return textual representation for the time that has elapsed.
xmppserver/src/main/java/org/jivesoftware/util/StringUtils.java