Here you can find the source of multiply(Duration duration, double factor)
public static Duration multiply(Duration duration, double factor)
//package com.java2s; //License from project: Open Source License import java.time.Duration; import java.time.temporal.ChronoUnit; public class Main { public static Duration multiply(Duration duration, double factor) { final long nanosPerSecond = ChronoUnit.SECONDS.getDuration().toNanos(); final long nanos = (long) (duration.getNano() * factor); return Duration.ofSeconds( Math.addExact((long) (duration.getSeconds() * factor), Math.floorDiv(nanos, nanosPerSecond)), Math.floorMod(nanos, nanosPerSecond)); }/*from www . j av a 2 s . co m*/ }