- 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
Advertisements