get Current Time In Milliseconds - Java java.util

Java examples for java.util:Millisecond

Description

get Current Time In Milliseconds

Demo Code


//package com.java2s;
import java.util.Calendar;

public class Main {
    public static void main(String[] argv) throws Exception {
        System.out.println(getCurrentTimeInMillisecs());
    }//from  w w  w.j  a v a  2  s .c om

    public static long getCurrentTimeInMillisecs() {
        Calendar cal = Calendar.getInstance();
        return cal.getTimeInMillis();
    }
}

Related Tutorials