# Timer

> Aego 0.12.5 · development; docs build `4a32b816933e02930662f6a443cb25abe6050d090c55e237cbff5c44ae9b25f8`. [Build manifest](/docs-build.json).

```
type Timer
```

Timer counts down and fires. yield t waits for the next fire or the end; a timer dies with the node of the script that made it.

## Timer.Cancel

```
func (Timer) Cancel()
```

Ends the timer without firing.

## Timer.Count

```
func (Timer) Count() int
```

Returns how many times the timer has fired.

## Timer.Done

```
func (Timer) Done() bool
```

Reports whether the timer ended, was cancelled or is nil.

## Timer.Pause

```
func (Timer) Pause()
```

Stops the countdown.

## Timer.Ready

```
func (Timer) Ready() bool
```

Reports whether a cooldown can be used.

## Timer.Remaining

```
func (Timer) Remaining() float
```

Returns the seconds left until the next fire.

## Timer.Repeat

```
func (Timer) Repeat(count int) Handle<aego/timer.Timer>
```

Makes the timer fire n times; -1 repeats until Cancel.

## Timer.Restart

```
func (Timer) Restart() bool
```

Starts the countdown again; it does nothing on a one-shot timer that already fired.

## Timer.Resume

```
func (Timer) Resume()
```

Continues a paused countdown.

## Timer.Unscaled

```
func (Timer) Unscaled() Handle<aego/timer.Timer>
```

Counts real time, also while the game is paused.

## Timer.Use

```
func (Timer) Use() bool
```

Takes a ready cooldown and starts its wait; it returns false while the cooldown runs.

## Timer.Fired

```
signal Fired(count int)
```

Runs on every fire of the timer; count is the number of fires so far.
