Package org.eclipse.birt.core.util

# Class BirtTimer

java.lang.Object
org.eclipse.birt.core.util.BirtTimer

public class BirtTimer extends Object
A timer class used to measure time taken for a specific operation.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected long`
`endTime`
`protected long`
`startTime`

## Constructor Summary

Constructors
Constructor
Description
`BirtTimer()`

## Method Summary

Modifier and Type
Method
Description
`int`
`delta()`
`void`
`logTimeTaken(Logger logger, Level level, String operationName)`
writes "{0} takes {1} Milliseconds." to log
`void`
`logTimeTaken(Logger logger, Level level, String id, String operationName)`
writes "{0} takes {1} Milliseconds." to log
`void`
`restart()`
restsrt timer
`void`
`start()`
start timer
`void`
`stop()`
stops timer

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### startTime

protected long startTime

### endTime

protected long endTime

## Constructor Details

### BirtTimer

public BirtTimer()

## Method Details

### start

public void start()
start timer

### stop

public void stop()
stops timer

### delta

public int delta()

Returns:
  the time difference between timer start and timer stop

### restart

public void restart()
restsrt timer

### logTimeTaken

public void logTimeTaken(Logger logger, Level level, String operationName)
writes "{0} takes {1} Milliseconds." to log

Parameters:
  `logger` - a Java logger object
  `level` - log level
  `operationName` - the operation name

### logTimeTaken

public void logTimeTaken(Logger logger, Level level, String id, String operationName)
writes "{0} takes {1} Milliseconds." to log

Parameters:
  `logger` - a Java logger object
  `level` - log level
  `id` - task identifier
  `operationName` - the operation name