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

# InterruptOccurred

Executes custom code when an interrupt occurs.

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

## Parameters

`action`

The action object that handles the interrupt event.

`count`

The number of interrupts that occurred.

`time`

The time at which the interrupt occurred. The system collects this value using the [`mach_absolute_time`](/documentation/DriverKit/mach_absolute_time) function.

## Discussion

Use this method as a prototype for declaring your own custom interrupt 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 respond to any interrupts that occurred.

---

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)