Outra classe de tempo, desta vez de formatar tempo. Ex: 3 minutos; 1 hora e 40 minutos
Exemplificação simples:
long d = TimeUnit.DAYS.toMillis(1);
long h = TimeUnit.HOURS.toMillis(12);
long m = TimeUnit.MINUTES.toMillis(30);
long s = TimeUnit.SECONDS.toMillis(45);
getLogger().info("Convertendo...");
getLogger().info(" " + TimeFormatter.format(d));
getLogger().info(" " + TimeFormatter.format(h));
getLogger().info(" " + TimeFormatter.format(m));
getLogger().info(" " + TimeFormatter.format(s));
getLogger().info(" " + TimeFormatter.format(d + h));
getLogger().info(" " + TimeFormatter.format(h + m));
getLogger().info(" " + TimeFormatter.format(m + s));
getLogger().info(" " + TimeFormatter.format(d + h + m));
getLogger().info(" " + TimeFormatter.format(h + m + s));
getLogger().info(" " + TimeFormatter.format(d + h + m + s));
Resultado:
[19:55:49 INFO]: [NtLibs] Convertendo...
[19:55:49 INFO]: [NtLibs] 1 dia
[19:55:49 INFO]: [NtLibs] 12 horas
[19:55:49 INFO]: [NtLibs] 30 minutos
[19:55:49 INFO]: [NtLibs] 45 segundos
[19:55:49 INFO]: [NtLibs] 1 dia e 12 horas
[19:55:49 INFO]: [NtLibs] 12 horas e 30 minutos
[19:55:49 INFO]: [NtLibs] 30 minutos e 45 segundos
[19:55:49 INFO]: [NtLibs] 1 dia, 12 horas e 30 minutos
[19:55:49 INFO]: [NtLibs] 12 horas, 30 minutos e 45 segundos
[19:55:49 INFO]: [NtLibs] 1 dia, 12 horas, 30 minutos e 45 segundos