Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Is there a simple way of implementing a timer feature in Java?

Posted on 2003-12-08
4
Medium Priority
?
309 Views
Last Modified: 2010-03-31
I was wondering whehter I could implement a simple timer in java is such a way that I could use it like.

if (time > 5){
Print time out exceeded
end program}

Thanks
0
Comment
Question by:welsh_boy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Accepted Solution

by:
blackwednesday earned 300 total points
ID: 9898592
You can use java.util.Timer to do something after a set delay, if that's what you want to do.
0
 
LVL 35

Assisted Solution

by:girionis
girionis earned 200 total points
ID: 9899143
 As suggested by blackwednesday a Timer would be the best choice. Take a look here: http://java.sun.com/docs/books/tutorial/essential/threads/timer.html for some examples of how to use them.
0
 

Author Comment

by:welsh_boy
ID: 9899368
Thanks for the quick response as always
0
 
LVL 35

Expert Comment

by:girionis
ID: 9899400
 Thank you. Glad we helped :)
0

Featured Post

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question