Results 1 to 2 of 2
  1. #1
    kewlkeny is offline Member
    Join Date
    May 2011
    Posts
    13
    Rep Power
    0

    Default How to add the time line for main class

    In my main class i have to add timer at the begin and at the end of the program, and want to check the time it took to execute ? How can i do this ? thank you

  2. #2
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default Re: How to add the time line for main class

    insert this line of code where you want to start to check the time

    long start = System.currentTimeMillis();

    and this line of code where you want to stop to check the time

    long stop = System.currentTimeMillis();

    and calculate the duration with stop - start.

Similar Threads

  1. making a Time class but Universal time always says 0
    By Bravid2001 in forum New To Java
    Replies: 2
    Last Post: 10-24-2011, 08:55 AM
  2. Replies: 0
    Last Post: 04-20-2011, 01:03 PM
  3. Running main method class from another main class
    By tlrocketman in forum New To Java
    Replies: 3
    Last Post: 12-06-2010, 09:30 AM
  4. Replies: 3
    Last Post: 08-25-2010, 11:21 AM
  5. Replies: 1
    Last Post: 06-30-2009, 03:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •