|
-
August 12th, 1999, 12:16 AM
#1
CPU time in Java
Can anyone tell me how to calculate in Java the CPU time taken by a thread?
-
August 12th, 1999, 07:56 AM
#2
Re: CPU time in Java
I didn't get the meaning of CPU time.
Do u want to measure performance of the thread? If yes...
Way 1:
1) get the time-stamp before starting thread
2) start thread and wait till thread stops
3) get the time-stamp and compare it with the prev one
Way 2:
Assuming u do all the processing in 'run' method of the thread,
1) get the time-stamp at the first line in 'run' method
2) do all the processing
3) get the time-stamp and compare it with the prev one
If u don't want this, then I'm sorry.
- UnicMan
http://members.tripod.com/unicman
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|