# CountdownTimer

## util CountdownTimer

CountdownTimer is a clock counts down from the time of last reset.</p.</div>

## Constructor

#### new CountdownTimer(startTimeopt)

Source:
  - util/Clock.js, line 157

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`startTime` | number | <optional> | `0` | the start time of the countdown

### Extends

- Clock

### Methods

#### add(deltaTimeopt)

Source:
  - util/Clock.js, line 183
Overrides:
  - Clock#add

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

Note: by adding time to t0, you push the current time forward (make it 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:
  - Clock#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 212
Overrides:
  - Clock#getTime

Get the time currently left on the countdown.

##### Returns:

the time left on the countdown (in seconds)

Type
  number

#### reset(newTimeopt)

Source:
  - util/Clock.js, line 194
Overrides:
  - Clock#reset

Reset the time on the countdown.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`newTime` | number | <optional> | if newTime is undefined, the countdown time is reset to zero, otherwise we set it to newTime