weka.filters.supervised.attribute.gpattributegeneration
Class Timer

java.lang.Object
  extended by weka.filters.supervised.attribute.gpattributegeneration.Timer

public class Timer
extends java.lang.Object

Timer class to replicate some of the C# Stopwatch functionality

Author:
Colin Noakes

Constructor Summary
Timer()
          Starts the timer
 
Method Summary
 long getElapsed()
          Gets time elapsed since the timer was started in milliseconds.
 double getElapsedSeconds()
          Gets time elapsed since the timer was started, in seconds.
 long getElapsedSinceSplit()
          Gets time elapsed since the timer's split function was used in milliseconds.
 double getElapsedSinceSplitSeconds()
          Gets time elapsed since the timer's split function was used, in seconds.
 long getTotalTime()
           
 double getTotalTimeSeconds()
           
 void startSplit()
          Starts a split timer
 void stop()
          Stops the timer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timer

public Timer()
Starts the timer

Method Detail

getElapsed

public long getElapsed()
Gets time elapsed since the timer was started in milliseconds.

Returns:
Time since timer was started in milliseconds

getElapsedSeconds

public double getElapsedSeconds()
Gets time elapsed since the timer was started, in seconds.

Returns:
Time since timer was started in seconds

getElapsedSinceSplit

public long getElapsedSinceSplit()
Gets time elapsed since the timer's split function was used in milliseconds.

Returns:
Time since the startSplit() method was called in milliseconds. If the startSplit() method was not called, returns 0;

getElapsedSinceSplitSeconds

public double getElapsedSinceSplitSeconds()
Gets time elapsed since the timer's split function was used, in seconds.

Returns:
Time since the startSplit() method was called in seconds. If the startSplit() method was not called, returns 0;

startSplit

public void startSplit()
Starts a split timer


stop

public void stop()
Stops the timer


getTotalTime

public long getTotalTime()
Returns:
Total time the timer ran for, in milliseconds

getTotalTimeSeconds

public double getTotalTimeSeconds()
Returns:
Total time the timer ran for, in seconds