Find out runtime of java program

Status
Not open for further replies.

laxman1790

Beta member
Messages
5
Hey guys I recently just got a homework assignment that said to write an algorithm to find a number in an array. The actual program was easy but he also requires that we output the actual runtime of the program in ms. Is there a way to output this through the code? Or possibly some other way? I'm using jgrasp as a java editor btw. Thanks a lot
 
Sorry buddy, can't help you with homework other than very general hints.
To do it outside code you are looking for a profiler I don't know if jgrasp includes one but it would be worth a google.
The hint for doing it inside code: "try describing the time the method takes without timing it".
Once you know what you are looking for it'll be easy to know how to get it (you'll kick yourself when you think of it).
 
Status
Not open for further replies.
Back
Top Bottom