Java tutorial
import static java.time.temporal.ChronoUnit.MILLIS; import java.time.LocalDateTime; public class Main { public static void main(String[] argv) { long millisBetween = MILLIS.between(LocalDateTime.now(), LocalDateTime.now().plusMinutes(1)); System.out.println("millisBetween = " + millisBetween); } }