com.sun.btrace
Class BTraceUtils.Time

java.lang.Object
  extended by com.sun.btrace.BTraceUtils.Time
Enclosing class:
BTraceUtils

public static class BTraceUtils.Time
extends java.lang.Object


Constructor Summary
BTraceUtils.Time()
           
 
Method Summary
static long millis()
          Returns the current time in milliseconds.
static long nanos()
          Returns the current value of the most precise available system timer, in nanoseconds.
static java.lang.String timestamp()
          Generates a string timestamp (current date&time) in the default system format
static java.lang.String timestamp(java.lang.String format)
          Generates a string timestamp (current date&time)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BTraceUtils.Time

public BTraceUtils.Time()
Method Detail

millis

public static long millis()
Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond, the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.

Returns:
the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.

nanos

public static long nanos()
Returns the current value of the most precise available system timer, in nanoseconds.

This method can only be used to measure elapsed time and is not related to any other notion of system or wall-clock time. The value returned represents nanoseconds since some fixed but arbitrary time (perhaps in the future, so values may be negative). This method provides nanosecond precision, but not necessarily nanosecond accuracy. No guarantees are made about how frequently values change. Differences in successive calls that span greater than approximately 292 years (263 nanoseconds) will not accurately compute elapsed time due to numerical overflow.

Returns:
The current value of the system timer, in nanoseconds.

timestamp

public static java.lang.String timestamp(java.lang.String format)

Generates a string timestamp (current date&time)

Parameters:
format - The format to be used - see SimpleDateFormat
Returns:
Returns a string representing current date&time
Since:
1.1

timestamp

public static java.lang.String timestamp()

Generates a string timestamp (current date&time) in the default system format

Returns:
Returns a string representing current date&time
Since:
1.1