summaryrefslogtreecommitdiff
path: root/java/src/ProfileTimer.java
blob: 6ce0d7ae811f7a8986ad98361b04ce0697e817fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*************************************************
 *
 * = PACKAGE
 *    ACE.Timers
 *
 * = FILENAME
 *    ProfileTimer.java
 *
 *@author Prashant Jain
 *
 *************************************************/
package ACE.Timers;

/**
 * <hr>
 * <p><b>TITLE</b><br>
 *     A Java wrapper for interval timers.
 */
public class ProfileTimer
{
  /**
   * Start the timer.
   */
  public void start ()
    {
      this.startTime_ = java.lang.System.currentTimeMillis ();
    }

  /**
   * Stop the timer.
   */
  public void stop ()
    {
      this.stopTime_ = java.lang.System.currentTimeMillis ();
    }

  /**
   * Determine elapsed time between start and stop.
   *@return Total elapsed time (stop - start).
   */
  public long elapsedTime ()
    {
      return this.stopTime_ - this.startTime_;
    }

  private long startTime_;
  private long stopTime_;
}