title: How can I count the time it takes a function to complete in Java?
body: <p>I need to measure the time it takes for a function to complete in Java. How can I do that?</p>
  <h3>Note:</h3>
  <p>I want to measure the <strong>function</strong>'s time consumption, not that of the full program.</p>