•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 456,507 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,666 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 4331 | Replies: 8
![]() |
just add a timer at the start of the program execution .... there are two types of timers .... one for gui and one is general
general:
java.util.Timer
Timer t = new Timer();
gui:
javax.swing.*
Timer t = new Timer(ActionListener, delay);
Read more about the timers in the java API.
general:
java.util.Timer
Timer t = new Timer();
gui:
javax.swing.*
Timer t = new Timer(ActionListener, delay);
Read more about the timers in the java API.
An alternative solution, I've used to as a cheap profiling trick in big programs:
long startTime = System.currentTimeMillis(); // time at start in millisecs
//
//code
//
long stopTime = System.currentTimeMillis(); // time at end
// time elapsed is stopTime-startTime
See this link for details.
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#currentTimeMillis()
long startTime = System.currentTimeMillis(); // time at start in millisecs
//
//code
//
long stopTime = System.currentTimeMillis(); // time at end
// time elapsed is stopTime-startTime
See this link for details.
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#currentTimeMillis()
•
•
Join Date: Mar 2008
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
An alternative solution, I've used to as a cheap profiling trick in big programs:
long startTime = System.currentTimeMillis(); // time at start in millisecs
//
//code
//
long stopTime = System.currentTimeMillis(); // time at end
// time elapsed is stopTime-startTime
See this link for details.
http://java.sun.com/j2se/1.4.2/docs/...ntTimeMillis()
it display in this format
1204531604270
How to display in time format?
![]() |
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Need help simply displaying time on an APP (Visual Basic 4 / 5 / 6)
- Displaying time on a Form (VB.NET)
- Having trouble displaying an Arrays. Please help. (C)
- program help (C)
Other Threads in the Java Forum
- Previous Thread: interface, or enum expected errors
- Next Thread: Problem in Unicode Parsing.



Linear Mode