File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Calculationg execution time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Calculationg execution time" Watch "Calculationg execution time" New topic

Calculationg execution time

Mahajan Bhupendra
Ranch Hand

Joined: Dec 01, 2000
Posts: 118
if i want to calculate time taken by my program to execute
how do i?
i can use threads but it will also count it's time to execute
is there any tool available with jdk??
thanks in advance

<B>Bhupendra Mahajan</B>
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
This has nothing to do with I/O (Input/Output), so I'm moving this to Java in General (Beginner).

"I'm not back." - Bill Harding, Twister
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
You could grab the time at the start and at the end and subtract.

"JavaRanch, where the deer and the Certified play" - David O'Meara
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Mahajan Bhupendra
Ranch Hand

Joined: Dec 01, 2000
Posts: 118
Thanks mike Thnku very much..
i was so frustrated that day that i couldn't think such a simple logic but thanks Mike..
Originally posted by Mike Curwen:

It is sorta covered in the JavaRanch Style Guide.
subject: Calculationg execution time
It's not a secret anymore!