hultig.util
Class CronoSensor

java.lang.Object
  extended by hultig.util.CronoSensor

public class CronoSensor
extends Object

A time sensor for counting execution times

Copyright: Copyright (c) 2006

Company: UBI - HULTIG


Field Summary
static byte DAYS
          Define the type "day"
static byte HOURS
          Define the type "hour"
static byte MINUTES
          Define the type "minutes"
static byte MSECONDS
          Define the type "milliseconds".
static byte SECONDS
          Define the type "seconds"
 
Constructor Summary
CronoSensor()
          Create current object and set time zero - start time
 
Method Summary
 long dt()
          Get the elapsed time since the chronometer was set to time zero.
 double dt(byte type)
          Get the elapsed time since the chronometer was set to time zero.
 String dts()
          The time in a string format
static String nowStamp()
          Return a string with the current date-time stamp, for example: 20100320171545.
 void set()
          Reset the chronometer to time zero for subsequente time measuring.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSECONDS

public static byte MSECONDS
Define the type "milliseconds".


SECONDS

public static byte SECONDS
Define the type "seconds"


MINUTES

public static byte MINUTES
Define the type "minutes"


HOURS

public static byte HOURS
Define the type "hour"


DAYS

public static byte DAYS
Define the type "day"

Constructor Detail

CronoSensor

public CronoSensor()
Create current object and set time zero - start time

Method Detail

set

public void set()
Reset the chronometer to time zero for subsequente time measuring.


dt

public long dt()
Get the elapsed time since the chronometer was set to time zero.


dt

public double dt(byte type)
Get the elapsed time since the chronometer was set to time zero.

Parameters:
type - One of the types defined previously: SECONDS, MINUTES, etc.
Returns:
The elapsed time since the chronometer was set to time zero, according to the correct interpretation or type.

dts

public String dts()
The time in a string format


nowStamp

public static String nowStamp()
Return a string with the current date-time stamp, for example: 20100320171545. The time precision is in the order of a second.

Returns:
String with current time stamp.