Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) throws Exception
- {
- Date startTime = new Date();
- long endTime = startTime.getTime() + 5000;
- Date endDate = new Date(endTime);
- Thread.sleep(3000);
- Date currentTime = new Date();
- if (currentTime.after(endDate))
- {
- System.out.println("End time!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement