for my first assignment we need to get the experimental run time of our program for various input sizes but I do not know where we can find the run time of the program in eclipse If someone could help me out I would greatly appreciate it.
Thanks!
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
for my first assignment we need to get the experimental run time of our program for various input sizes but I do not know where we can find the run time of the program in eclipse If someone could help me out I would greatly appreciate it.
Thanks!
There are methods in the System class that will return the current time.
Get the time at the start and end and subtract.
alright so i did that and got:
23465106954281 end
23465106493853 start
difference of 460428 ns. or 0.460428 milliseconds. sound good?
You were the one watching the code run. Does about 1/2 second look right?
Put in a loop that goes a million times and see how long that takes.
i meant in terms of a simple program is that a good run time but its fine it seems to be running at around .03 ms per input. in a linear fashion so i guess its good.
It all depends....is that a good run time