Java System.currentTimeMillis()

Syntax

System.currentTimeMillis() has the following syntax.

public static long currentTimeMillis()

Example

In the following code shows how to use System.currentTimeMillis() method.


// w ww.j a v  a2  s  .  c  om
public class Main {

   public static void main(String[] args) {

      System.out.print("Current Time in milliseconds = ");
      System.out.println(System.currentTimeMillis());
  }
}




















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable