File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Threads and Synchronization and the fly likes How long a thread has been running Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "How long a thread has been running" Watch "How long a thread has been running" New topic
Author

How long a thread has been running

Adamu Yifru
Greenhorn

Joined: May 22, 2003
Posts: 6
Is there a way to tell how long a thread has been running?
thanks in advance.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

Hi,
Only by recording the time at which you started it. If it's just some random thread, I don't believe there's any way to tell.


[Jess in Action][AskingGoodQuestions]
Vinod Chandana
Ranch Hand

Joined: Aug 26, 2003
Posts: 59
Originally posted by Adamu Yifru:
Is there a way to tell how long a thread has been running?
thanks in advance.

hi,
In a way Ernest is right. But probably it is possible to try to find the execution time of a thread. Look at the code I have attached. Let me tell you that this is not really accurate. But it kinda works. Hope this helps.
Regards,
Vinod.
Make me a cowboy!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How long a thread has been running
 
Similar Threads
This bb is very dead.
Client hanging
interrupt operations if session closed
anybody have experience purchasing voucher from this link?
How to keep track of running time of a thread