JAVA

currentTimeMillis

김T준 2021. 7. 14. 12:44
728x90
System.currentTimeMillis( )

 

밀리세컨드로 나타낸 현재까지의 유닉스 시간

 

주로 프로그램의 구동시간을 측정할 때 사용된다.

 

ex)

long stratT = System.currentTimeMillis();

//// 측정할 코드 ////

long endT = System.currentTimeMillis();

System.out.println((endT - stratT) / 1000.0);		//구동시간 초단위로 출력