---
title: "CFRunLoopAddTimer(_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfrunloopaddtimer(_:_:_:)"
---

# CFRunLoopAddTimer(_:_:_:)

Adds a CFRunLoopTimer object to a run loop mode.

## Declaration

```swift
func CFRunLoopAddTimer(_ rl: CFRunLoop!, _ timer: CFRunLoopTimer!, _ mode: CFRunLoopMode!)
```

## Parameters

- `rl`: The run loop to modify.
- `timer`: The run loop timer to add.
- `mode`: The run loop mode of rl to which to add timer. Use the constant doc://com.apple.corefoundation/documentation/CoreFoundation/CFRunLoopMode/commonModes to add timer to the set of objects monitored by all the common modes.

## Discussion

Discussion A run loop timer can be registered in only one run loop at a time, although it can be added to multiple run loop modes within that run loop. If rl already contains timer in mode, this function does nothing.

## See Also

### Managing Timers

- [CFRunLoopGetNextTimerFireDate(_:_:)](corefoundation/cfrunloopgetnexttimerfiredate(_:_:).md)
- [CFRunLoopRemoveTimer(_:_:_:)](corefoundation/cfrunloopremovetimer(_:_:_:).md)
- [CFRunLoopContainsTimer(_:_:_:)](corefoundation/cfrunloopcontainstimer(_:_:_:).md)
