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 2 of 2

Thread: current execution time of a class in java by running another class

  1. #1
    Junior Member
    Join Date
    Jul 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default current execution time of a class in java by running another class

    i want to write a class in such a way that i should get the current execution time of another class which is running. I searched in net but it shows only how to calculate the time duration of the current class which is running. But as per my way, i need the execution time of one class from another class. How to do this ?


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: current execution time of a class in java by running another class

    Welcome to the Forum! Please read this topic to learn how to post code correctly and other useful tips for newcomers.

    Class1 instance: create an instance of Class2, sending the calling instance of Class1 instance
    Class2 instance: perform initialization (constructor activity), as needed, tell Class1 instance to start the clock, run timed code, tell Class1 instance to stop the clock when timed code is complete
    Class1 or Class2 instance: report results.

    Good luck!

Similar Threads

  1. [SOLVED] Get path of current executing class
    By Andrew R in forum What's Wrong With My Code?
    Replies: 12
    Last Post: August 25th, 2013, 11:08 AM
  2. Replies: 2
    Last Post: November 18th, 2012, 02:09 PM
  3. Execution of .jar file: Could not find main class....Error'
    By suyog53 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: October 14th, 2012, 02:04 PM
  4. Replies: 3
    Last Post: June 17th, 2012, 06:22 PM
  5. java threading execution time question
    By centenial in forum Threads
    Replies: 4
    Last Post: September 8th, 2010, 11:32 PM

Tags for this Thread