Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timestamp

Status
Not open for further replies.

newbieKing

Programmer
Jan 29, 2003
19
CA
Hi, I want to know how to figure out how long it takes for my program to run. I need a timestamp at the beginning and the end in order to find the total run time. Does anybody know of a class that I could use?
Thanks
 
I think System.currentTimeMilis() will do the trick.

Cheers,

Dian
 
You want to do :

Code:
long start = System.currentTimeMilis();
// do your stuff
long timeTakenInMillis = System.currentTimeMilis() - start;
System.out.println("Time take in millis : " +timeTakenInMillis );

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top