java.time.Duration.multipliedBy() 方法示例


java.time.Duration.multipliedBy() 方法示例

package com.codingdict;

import java.time.Duration;

public class DurationDemo {
   public static void main(String[] args) {

      Duration duration = Duration.ofSeconds(5);
      System.out.println(duration.getSeconds());
      Duration duration1 = duration.multipliedBy(3);
      System.out.println(duration1.getSeconds());
   }
}