<!--
{
  "availability" : [
    "DriverKit: -",
    "iOS: -",
    "iPadOS: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/IOTimerDispatchSource/TimerOccurred",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "DriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOTimerDispatchSource@F@TimerOccurred#*$@S@OSAction#k#"
  },
  "title" : "TimerOccurred"
}
-->

# TimerOccurred

Executes custom code when the timer fires.

```
virtual void TimerOccurred(OSAction *action, uint64_t time);
```

## Parameters

`action`

The action object being executed.

`time`

The actual time at which the timer fired. The system calls [`mach_absolute_time`](/documentation/DriverKit/mach_absolute_time) precisely when the timer fires and passes that value to this parameter.

## Discussion

Use this method as a prototype for declaring your own custom timer handlers. When declaring your method, use the [`TYPE`](/documentation/DriverKit/TYPE) macro to indicate that your method has the same parameters and return value as this method.

Use the implementation of your method to perform any custom actions related to the timer’s expiration.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)