Example usage for java.time Duration plusNanos

List of usage examples for java.time Duration plusNanos

Introduction

In this page you can find the example usage for java.time Duration plusNanos.

Prototype

public Duration plusNanos(long nanosToAdd) 

Source Link

Document

Returns a copy of this duration with the specified duration in nanoseconds added.

Usage

From source file:Main.java

public static void main(String[] args) {
    Duration duration = Duration.between(LocalTime.MIDNIGHT, LocalTime.NOON);
    duration = duration.plusNanos(1000);
    System.out.println(duration.getNano());

}