org.reprap.utilities
Class Timer

java.lang.Object
  extended by org.reprap.utilities.Timer

public class Timer
extends java.lang.Object

Author:
Adrian I bet there's a system utility somewhere to do this...

Field Summary
private  long delta
          Time since last call
private  long t
          Time now
private  long t0
          Time at the start
private  java.text.DecimalFormat threeDec
          for 3 d.p.
private static Timer tim
          Static single instance to hold all times
 
Constructor Summary
private Timer()
          Constructor just needs to create a single instance for initialiseIfNeedBe(String e)
 
Method Summary
private static java.lang.String d3dp(double v)
          Get a double as a 3 d.p.
static double elapsed()
          Get the time from the start in seconds
private static void initialiseIfNeedBe()
          Check if we've been initialised and initialise if needed
private static void newTime()
          What o'clock have you?
static java.lang.String stamp()
          Generate a timestamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

t0

private long t0
Time at the start


t

private long t
Time now


delta

private long delta
Time since last call


threeDec

private java.text.DecimalFormat threeDec
for 3 d.p.


tim

private static Timer tim
Static single instance to hold all times

Constructor Detail

Timer

private Timer()
Constructor just needs to create a single instance for initialiseIfNeedBe(String e)

Method Detail

newTime

private static void newTime()
What o'clock have you?


initialiseIfNeedBe

private static void initialiseIfNeedBe()
Check if we've been initialised and initialise if needed

Parameters:
e -

d3dp

private static java.lang.String d3dp(double v)
Get a double as a 3 d.p. string

Parameters:
v -
Returns:

stamp

public static java.lang.String stamp()
Generate a timestamp

Returns:

elapsed

public static double elapsed()
Get the time from the start in seconds

Returns: