![JAR search and dependency download from the Maven repository](/logo.png)
net.sourceforge.plantuml.stats.HumanDuration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-mit Show documentation
Show all versions of plantuml-mit Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.stats;
class HumanDuration {
private final long duration;
public HumanDuration(long duration) {
this.duration = duration;
}
@Override
public String toString() {
long time = duration;
// final long ms = time % 1000L;
time = time / 1000;
final long sec = time % 60;
time = time / 60;
final long min = time % 60;
time = time / 60;
final long hour = time % 24;
final long day = time / 24;
if (day > 0) {
return String.format("%dd %02dh%02dm%02ds", day, hour, min, sec);
}
if (hour > 0) {
return String.format("%dh%02dm%02ds", hour, min, sec);
}
if (min > 0) {
return String.format("%dm%02ds", min, sec);
}
return String.format("%ds", sec);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy