# Clock

## util Clock

Clock is a MonotonicClock that also offers the possibility of being reset.

## Constructor

#### new Clock()

Source:
  - util/Clock.js, line 118

### Extends

- MonotonicClock

### Methods

#### add(deltaTimeopt)

Source:
  - util/Clock.js, line 146

Add more time to the clock's 'start' time (t0).

Note: by adding time to t0, the current time is pushed forward (it becomes smaller). As a consequence, getTime() may return a negative number.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`deltaTime` | number | <optional> | the time to be added to the clock's start time (t0)

#### getLastResetTime() → {number}

Source:
  - util/Clock.js, line 39
Overrides:
  - MonotonicClock#getLastResetTime

Get the current offset being applied to the high resolution timebase used by this Clock.

##### Returns:

the offset (in seconds)

Type
  number

#### getTime() → {number}

Source:
  - util/Clock.js, line 29
Overrides:
  - MonotonicClock#getTime

Get the current time on this clock.

##### Returns:

the current time (in seconds)

Type
  number

#### reset(newTimeopt)

Source:
  - util/Clock.js, line 133

Reset the time on the clock.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`newTime` | number | <optional> | `0` | the new time on the clock.