get current system time in nanoseconds java

Solutions on MaxInterview for get current system time in nanoseconds java by the best coders in the world

showing results for - "get current system time in nanoseconds java"
Yahir
04 Jun 2018
1package com.tutorialspoint;
2
3import java.lang.*;
4
5public class SystemDemo {
6
7   public static void main(String[] args) {
8
9      // returns the current value of the system timer, in nanoseconds
10      System.out.print("time in nanoseconds = ");
11      System.out.println(System.nanoTime());
12
13      // returns the current value of the system timer, in milliseconds
14      System.out.print("time in milliseconds = ");
15      System.out.println(System.currentTimeMillis());
16   }
17}