---
title: addTimerEvent
framework: kernel
role: pseudoSymbol
path: kernel/ioaudiodevice/1811662-addtimerevent
---

# addTimerEvent

Adds a TimerEvent callback for the given target called at least as often as specified in interval.

## Declaration

```occ
virtual IOReturn addTimerEvent(
 OSObject *target,
 TimerEventevent,
 AbsoluteTimeinterval); 
```

## Parameters

- `target`: This parameter is the target object of the TimerEvent.
- `event`: The callback function called each time the timer fires.
- `interval`: The callback will be called at least this often.

## Return Value

Return Value Returns kIOReturnSuccess if the timer event was successfully added.

## Overview

Overview The frequency of the timer event callbacks will be the smallest interval specified by all targets. Only one interval and callback may be specified per target. If a addTimerEvent is called twice with the same target, the second one overrides the first. There is currently a bug triggered if the first call had the smallest interval. In that case, that smallest interval would still be used.

## See Also

### Miscellaneous

- [activateAudioEngine(IOAudioEngine *)](kernel/ioaudiodevice/1811648-activateaudioengine.md)
- [activateAudioEngine(IOAudioEngine *, bool)](kernel/ioaudiodevice/1811655-activateaudioengine.md)
- [attachAudioPort](kernel/ioaudiodevice/1811666-attachaudioport.md)
- [audioEngineStarting](kernel/ioaudiodevice/1811673-audioenginestarting.md)
- [audioEngineStopped](kernel/ioaudiodevice/1811679-audioenginestopped.md)
- [completePowerStateChange](kernel/ioaudiodevice/1811685-completepowerstatechange.md)
- [completePowerStateChangeAction](kernel/ioaudiodevice/1811692-completepowerstatechangeaction.md)
- [deactivateAllAudioEngines](kernel/ioaudiodevice/1811697-deactivateallaudioengines.md)
- [detachAllAudioPorts](kernel/ioaudiodevice/1811704-detachallaudioports.md)
- [dispatchTimerEvents](kernel/ioaudiodevice/1811710-dispatchtimerevents.md)
- [flushAudioControls](kernel/ioaudiodevice/1811716-flushaudiocontrols.md)
- [free](kernel/ioaudiodevice/1811723-free.md)
- [getCommandGate](kernel/ioaudiodevice/1811730-getcommandgate.md)
- [getPendingPowerState](kernel/ioaudiodevice/1811740-getpendingpowerstate.md)
- [getPowerState](kernel/ioaudiodevice/1811749-getpowerstate.md)
- [getWorkLoop](kernel/ioaudiodevice/1811757-getworkloop.md)
- [init](kernel/ioaudiodevice/1811765-init.md)
- [initHardware](kernel/ioaudiodevice/1811773-inithardware.md)
- [initiatePowerStateChange](kernel/ioaudiodevice/1811782-initiatepowerstatechange.md)
- [performPowerStateChange](kernel/ioaudiodevice/1811791-performpowerstatechange.md)
- [protectedCompletePowerStateChange](kernel/ioaudiodevice/1811798-protectedcompletepowerstatechang.md)
- [protectedSetPowerState](kernel/ioaudiodevice/1811807-protectedsetpowerstate.md)
- [removeAllTimerEvents](kernel/ioaudiodevice/1811813-removealltimerevents.md)
- [removeTimerEvent](kernel/ioaudiodevice/1811823-removetimerevent.md)
- [setConfigurationApplicationBundle](kernel/ioaudiodevice/1811829-setconfigurationapplicationbundl.md)
- [setDeviceCanBeDefault](kernel/ioaudiodevice/1811833-setdevicecanbedefault.md)
- [setDeviceName](kernel/ioaudiodevice/1811841-setdevicename.md)
- [setDeviceShortName](kernel/ioaudiodevice/1811844-setdeviceshortname.md)
- [setFamilyManagePower](kernel/ioaudiodevice/1811848-setfamilymanagepower.md)
- [setIdleAudioSleepTime](kernel/ioaudiodevice/1811852-setidleaudiosleeptime.md)
- [setManufacturerName](kernel/ioaudiodevice/1811862-setmanufacturername.md)
- [setPowerState](kernel/ioaudiodevice/1811867-setpowerstate.md)
- [setPowerStateAction](kernel/ioaudiodevice/1811878-setpowerstateaction.md)
- [start](kernel/ioaudiodevice/1811891-start.md)
- [stop](kernel/ioaudiodevice/1811898-stop.md)
- [timerFired](kernel/ioaudiodevice/1811908-timerfired.md)
- [waitForPendingPowerStateChange](kernel/ioaudiodevice/1811913-waitforpendingpowerstatechange.md)
