Results 1 to 2 of 2
  1. #1
    überfuzz is offline Member
    Join Date
    Feb 2011
    Posts
    43
    Rep Power
    0

    Default Time a recursive function

    I'd like to time a recursive function. Is there a neat way of doing this in the function it self or do I have to time it from out side?

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,271
    Blog Entries
    7
    Rep Power
    24

    Default

    Quote Originally Posted by überfuzz View Post
    I'd like to time a recursive function. Is there a neat way of doing this in the function it self or do I have to time it from out side?
    Do it outside of that method because, if you do it in the method itself you need a condition to figure out whether or not the method has been called for the first time and whether or not it is returning for the last time; with recursive methods that can be a bit messy and it takes some (a bit?) of time.

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

Similar Threads

  1. Calling function in Javascript- from other function
    By jdigger in forum New To Java
    Replies: 1
    Last Post: 02-27-2011, 10:00 PM
  2. recursive function
    By jayden in forum New To Java
    Replies: 11
    Last Post: 09-02-2010, 03:00 PM
  3. Replies: 3
    Last Post: 12-04-2009, 04:08 PM
  4. Understanding this recursive function
    By LifeWithJava in forum New To Java
    Replies: 3
    Last Post: 12-30-2008, 06:26 AM
  5. Help with recursive function in java
    By cachi in forum Advanced Java
    Replies: 2
    Last Post: 07-31-2007, 06:51 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
  •