Use currentTimeMillis() method in Java to display the computer time in milliseconds.
Here we are getting the milliseconds in long type −
long res = System.currentTimeMillis();
The following is an example −
public class Demo { public static void main(String[] a) { long res = System.currentTimeMillis(); System.out.println(res); } }
1543142485568