All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.dedicon.pipeline.braille.step.MessageContainer Maven / Gradle / Ivy

There is a newer version: 2.0.1
Show newest version
package nl.dedicon.pipeline.braille.step;

import java.time.Duration;
import java.time.LocalDateTime;

public class MessageContainer {

    private LocalDateTime dateTime = LocalDateTime.now();
    
    public void reset() {
        dateTime = LocalDateTime.now();
    }
    
    public String getElapsedTime() {
        Duration duration = Duration.between(dateTime, LocalDateTime.now());
        long millis = duration.toMillis();
        long seconds = millis/1000;
        long millisPart = millis % 1000;
        long minutes = seconds/60;
        long secondsPart = seconds % 60;
        return String.format("%d:%02d.%03d", minutes, secondsPart, millisPart);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy