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.

Results 1 to 6 of 6

Thread: In eclipse how do you get the runtime of your program?

  1. #1
    Junior Member
    Join Date
    May 2011
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default In eclipse how do you get the runtime of your program?

    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!


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: In eclipse how do you get the runtime of your program?

    There are methods in the System class that will return the current time.
    Get the time at the start and end and subtract.

  3. #3
    Junior Member
    Join Date
    May 2011
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: In eclipse how do you get the runtime of your program?

    alright so i did that and got:
    23465106954281 end

    23465106493853 start

    difference of 460428 ns. or 0.460428 milliseconds. sound good?

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: In eclipse how do you get the runtime of your program?

    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.

  5. #5
    Junior Member
    Join Date
    May 2011
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: In eclipse how do you get the runtime of your program?

    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.

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: In eclipse how do you get the runtime of your program?

    is that a good run time
    It all depends....

Similar Threads

  1. Replies: 24
    Last Post: August 4th, 2014, 12:49 PM
  2. Runtime Error
    By SyntheticD in forum What's Wrong With My Code?
    Replies: 5
    Last Post: February 10th, 2011, 04:09 PM
  3. using Eclipse and every program gives the errorr with floating numbers
    By Neera in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 30th, 2010, 12:11 PM
  4. Runtime Error running in UVA
    By mathfxr in forum What's Wrong With My Code?
    Replies: 1
    Last Post: September 17th, 2010, 02:06 PM
  5. Create buttons at runtime
    By rtumatt in forum AWT / Java Swing
    Replies: 2
    Last Post: May 24th, 2010, 06:42 AM