- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java Program to display computer time in milliseconds
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 −
Example
public class Demo { public static void main(String[] a) { long res = System.currentTimeMillis(); System.out.println(res); } }
Output
1543142485568
- Related Articles
- Java Program to display date and time in Milliseconds
- Display entire date time with milliseconds in Java
- Computer elapsed time of an operation in milliseconds in Java
- Java Program to get Milliseconds between two time instants
- Java Program to display Current Time in another Time Zone
- Get time in milliseconds using Java Calendar
- Java Program to display Time in 12-hour format
- Java Program to display time in 24-hour format
- Java Program to Display time in different country’s format
- Java Program to Display current Date and Time
- How to get Time in Milliseconds for the Given date and time in Java?
- Java Program to display date and time information in lowercase
- Java Program to display date and time information in uppercase
- Program to convert Milliseconds to Date Format in Java
- Java Program to convert Date into milliseconds

Advertisements